For a normal pub-sub flow you can have something like below:
Set, the queue name of MQInput node to your input queue. Let's name it as "inputQ".
Now the message has been read by MQInput node from the "inputQ" and it has been passed on to the compute node.
In the compute node you need to set the message type to publish and also set the topic name, before you pass it to the Publication node.
You can use below code for the same:
SET OutputRoot.MQRFH2.psc.Command = 'Publish';
SET OutputRoot.MQRFH2.psc.Topic = 'YourTopicString';
"How do I register subscriber/multiple subscribers in this flow? "
I am assuming your problem is "How to publish message with different topics from same flow".
Now suppose you have multiple topics to be published from the same flow. You can't do it all at once. One message can have one topic.
But, you can achieve it as below (Suppose you have 3 topics):
SET OutputRoot.MQRFH2.psc.Command = 'Publish';
SET OutputRoot.MQRFH2.psc.Topic = 'Topic1';
PROPAGATE TO TERMINAL 'out' DELETE NONE;
SET OutputRoot.MQRFH2.psc.Topic = 'Topic2';
PROPAGATE TO TERMINAL 'out' DELETE NONE;
SET OutputRoot.MQRFH2.psc.Topic = 'Topic3';
PROPAGATE TO TERMINAL 'out' DELETE NONE;
RETURN FALSE;
However, if your requirement is publishing single topic but multiple queues should pick it up, then its simpler.
You just need to create subscriptions for all those queues for your topic.