<-- Back

How to receive and process messages from a queue with the SAP Event Mesh Connector

Issue

After setting up SAP Event Mesh and installing the SAP Event Mesh Connector from the Mendix Marketplace, a queue subscription was successfully created from the Mendix app. However, it was unclear how the messages sent by SAP are actually received and processed in the app. The expectation was that the connector would act as a broker that pushes incoming messages to the application, for example by allowing a microflow to be passed as a parameter, which would then be triggered for each incoming message. The connector does not support this option, and the documentation does not clarify how messages should be handled after subscribing to a queue.

Environment

SAP Event Mesh Connector (all versions)

Cause

The SAP Event Mesh Connector does not provide a push mechanism. Creating a queue subscription only links a topic to a queue in SAP Event Mesh; it does not register a callback or microflow in the Mendix app. Messages remain in the queue until the application actively retrieves them, so a pull-based approach must be implemented in the app.

Solution/Workaround

Messages must be consumed from the queue by the Mendix application itself. Use the activities delivered with the SAP Event Mesh Connector as follows:

  1. Configure the module with the required SAP Event Mesh credentials (management credentials and messaging credentials).

  2. Use the CreateQueueSubscription activity to create the subscription. This activity requires the management credentials, the topic or topics to be created, and the queue or queues subscribed to the topic. This only creates the binding between topic and queue in SAP Event Mesh.

  3. Use the ConsumeMessage activity to retrieve a message from the queue. This activity requires the credentials and the queue name as parameters.

  4. Handle the returned ConsumeResponse object, which contains the message ID and the message content. This is a non-persistable entity, so if the message needs to be kept for a longer period, either store the content in another entity or change the entity to persistable.

  5. To keep receiving new messages, call the microflow containing the ConsumeMessage activity repeatedly, for example by using a scheduled event that runs at a regular interval. Add the required processing logic (parsing, mapping, and storing the message content) after the consume activity.

Internal information related

  • 287720
  • C0161C11YH1/p1789114589029639

Additional information

Have more questions? Submit a request

0 Comments

Article is closed for comments.

To provide feedback, please open a ticket here. Don't forget to include the article's URL along with the feedback you would like to provide.