sancsan
sancsan

Reputation: 11

Publish message on multiple topic strings (IBM Integration Bus)

I've a scenario where I would receive message using MQ Input node and based on the value of source system present in the message, I need to form topic string and publish the message. This is how my flow looks like:

MQInput -> Compute -> Publication

And I populate the value of Topic using: SET OutputRoot.Properties.Topic = 'TopicName/' || sourceName ;

This works fine in case message contains one source system.

However there is possibility that message contain multiple source system. Is it possible to use the above mentioned command to publish the messages on multiple topic string? (something like this)

SET OutputRoot.Properties.Topic = 'Topic/' || sourceName1 ;

SET OutputRoot.Properties.Topic = 'Topic/' || sourceName2 ;

Appreciate any suggestions.

Upvotes: 1

Views: 1453

Answers (2)

jdel
jdel

Reputation: 566

In the properties, you can set only one value for each property.

To do what you want to do, you have to generate multiple message, and this is done by using the PROPAGATE keyword in ESQL as suggested above.

Upvotes: 0

Attila Repasi
Attila Repasi

Reputation: 1830

You should propagate 2 separate messages from the Compute node with different topic strings set.

You can propagate a message without returning by using the PROPAGATE ESQL statement. So your code should look something like this:

<Create message in OutputRoot>

SET OutputRoot.Properties.Topic = 'TopicName/' || sourceName1;
PROPAGATE DELETE NONE;

SET OutputRoot.Properties.Topic = 'TopicName/' || sourceName2;
RETURN TRUE;

Upvotes: 2

Related Questions