Question on EDA: How to read event content in an EDA subscription?

I would like to read the content of an event in a service subscribed to the event type. I have tried the following:
• Created a document type based on the {Software AG Product Documentation}PartInventoryLow sample event type → EventTester:EventTesterDocTypeInventoryLow
• Created a service EventTester:EventTesterProcessInventoryLowEvent to process an InventoryLow event. Following the instructions in the webMethods Integration Server Built-In Services Reference for pub.event.routing:subscribe, the service has only one input parameter of type pub.event.eda:event
• Created a service EventTester:EventTesterSubscribeToInventoryLowEvent to subscribe the EventTester:EventTesterProcessInventoryLowEvent service to the {Software AG Product Documentation}PartInventoryLow event type. The service is running successfully
• Created a service EventTester:EventTesterEmitInventoryLowEvent sending an event with an instance of the EventTester:EventTesterDocTypeInventoryLow document type as evt:Body, specifying {Software AG Product Documentation}PartInventoryLow as evt:Type

When I run the EventTester:EventTesterEmitInventoryLowEvent service, I can see that a message with the right content is sent to the /Event/WebM/Sample/InventoryMgmt/1.0/PartInventoryLow channel in UM, and the EventTester:EventTesterProcessInventoryLowEvent service is called correctly. But it seems I do not get any input in the input parameter of type pub.event.eda:event! When I enable the „Validate input“ checkbox for the EventTester:EventTesterEmitInventoryLowEvent service, it will not even be started. I can see the following error message in the IS log:
• [3862]2016-12-13 12:39:24 CET [ISS.0059.0001W] Interrupted [ISC.0049.9005] Input validation for service ‘EventTester:EventTesterProcessInventoryLowEvent’ failed: ‘/MyInput VV-005 [ISC.0082.9034] Field is absent, field must exist’

So it seems that the EDA platform does not forward the event content correctly. Any idea how I would be able to read the event content in my EventTester:EventTesterEmitInventoryLowEvent service? Thanks for your help!

Best regards,
Thomas

Hi Thomas,

Can you please provide clarifications for the below points.

  1. How you publish the event to UM

  2. In UM, Did we need to create any queue or topic for the published event.

  3. Did we need to create any trigger for subscribing the event.

  4. In Command Central, Under Digital Event Service, we are having Messaging Service named Universal Messaging. we are configuring the Messaging Service as source and destination in our service group. What is the purpose of the Messaging Service and Service Group?

5.How to Moniter the Event that is being Published and Subscribed.

Regards,
Karthik

Hi Thomas,

as far as I can judge you are facing 2 different issues.

  1. Your ‘Process’ service is actually called but you cannot access the event data for some reason
  2. Using “Validate Input” shows an error about a missing field

Please see my comments

ad (2)
The fields defined in the PartInventoryLow type are not optional. An event instance is not valid according to this schema in the case where at least one field is not present. Because of this I suspect that the ‘Emit’ service publishes an event where at least one field value is missing. You can proove this assumption by using the createOptions paramater at pub.event.routing:send service. Use VALIDATE_BODY option in order to validate the event already on emit.

ad (1)
The ‘Process’ service is called with the event which consists of the event header and body. The event is given as XML strinfg. Because of this you need to firstly convert the string into XML document and secondly convert the XML document into an IS document. This is done by using pub.xml:xmlStringToXMLNode and pub.xml:xmlNodeToDocument.

Please find attached a demo IS package based on the PartInventoryLow event type. It basically does what you want to achieve. It consists of a a service to process PartInventoryLow events and a svc to publish such events. Additonally it contains a svc to subscribe the ‘Process’ svc. This should work out of the box.

Cheers,
Martin

DemoEventRouting.zip (14.5 KB)