on ‎2018 Apr 04 9:54 AM - last edited on ‎2024 Feb 04 5:12 AM by postmig_api_4
How to create custom data-feeds/pools for data-hub from data-hub side.? I can create from backoffice ,that means i need to deploy from backoffice .but i want from datahub side ,so i can take care while hitting the URL . Where do i need to do configuration ?
Request clarification before answering.
Hi Manish,
You can use REST Commands to do this.
Send a POST request to datahuburl/datahub-webapp/v1/data-feeds with the body
{
"name": "HybrisFeed",
"description": "hybris feed.",
"poolingStrategy": "NAMED_POOL",
"poolingCondition": "HybrisPool"
}
Then you will be able to send GET and POST requests to that feed/pool.
For Example:
Create Raw Items: POST {{host}}/data-feeds/HybrisFeed/items/RawCategory
Get the status of the compositions: GET {{host}}/pools/HybrisPool/compositions
Regards,
Luke
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This can also be done using event listeners in data hub. One common case is creating an event listener for DataHubInitializationCompletedEvent and on that event use DataHubFeedService
to create those feeds.
The solution book at help.hybris.com has the sample.
https://help.hybris.com/6.5.0/hcd/8ac5f84bad6d48a7ba9f71a1271d700d.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To create custom feed/pool , we need to create some csv files under 'META-INF/essential-data' folder
Create custom maven project and add below files structure
├── src
│ └── main
│ └── resources
│ └── META-INF
│ ├── essential-data
│ │ ├── essential-data.mcsv
│ │ ├── custom-feed.csv
│ │ └── custom-pool.csv
essential-data.mcsv
# imports default feeds and pools
DataHubPool,custom-pool.csv
DataHubFeed,custom-feed.csv
custom-pool.csv
poolId,poolName
20000,"CUSTOM_POOL"
custom-feed.csv
feedId,name,description,poolingStrategy,poolingCondition
20000,"CUSTOM_FEED","New custom feed","NAMED_POOL","CUSTOM_POOL"
Configure this feed in spring file for raw item mapping service and add this custom pool to local.properties file for autocompose and auto publications
Regards Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i tried adding under *raw\src\main\resources\META-INF ,but could not get success. here is the error: execution on DataHubInitializationCompletedEvent{}. Continuing to notify other listeners. com.hybris.kernel.persistence.exporting.Serializatio nException: headers [poolId, poolName] line [2] content [20000,"CUSTOM_POOL"] Caused by: Unknown attribute poolId 13:58:59 [WARN] [c.z.h.p.ProxyConnection] datahub - Connection com.mysql.jdbc.JDBC4Connection@2832c53e marked as broken because of SQLSTATE() Hey , could u pls pass me the more detailed steps .not sure where do i need to add ? Manish
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.