cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to create custom data-feeds/pools for data-hub form datahub side?

Former Member
0 Likes
1,098

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 ?

Accepted Solutions (1)

Accepted Solutions (1)

former_member387866
Active Contributor
0 Likes

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

Former Member
0 Likes

Thanks!!! Successfully i executed the steps and same verified the output.

Answers (2)

Answers (2)

Former Member
0 Likes

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

Former Member
0 Likes

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

Former Member
0 Likes

Hi Kiran,

Do i need to keep above csv under *raw\src\main\resources\META-INF ?

Manish

Former Member
0 Likes

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