Author |
Message
|
mbtech |
Posted: Wed Feb 13, 2013 9:29 pm Post subject: PUB/SUB in MB and MQ |
|
|
Apprentice
Joined: 18 Jul 2012 Posts: 36
|
I have configured a pub/sub in mq7 with 2 topics 2 alias queues for topics and 3 outputqueues for 4 subscriptions
Q1 subscribed for topic1 only
Q2 subscribed both topics 1 & 2
Q3 subscribed for topic2 only
I develop a flow in MB taking 2 alias queues as input queues and 3 output queues using destination list coding as
Code: |
SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = 'SUB.INQ.SPORTS';
SET OutputLocalEnvironment.Destination.MQ.DestinationData[2].queueName = 'SUB.INQ.SPORTSNSTOCKS';
SET OutputLocalEnvironment.Destination.MQ.DestinationData[3].queueName = 'SUB.INQ.STOCKS';
|
when i send a message in input q i.e topic1 alias q its going to only one queue i need to get it in Q1 & Q2 also
Same with the case of Topic2 where it has to come for Q2 & Q3
Let me know any inputs |
|
Back to top |
|
 |
kash3338 |
Posted: Thu Feb 14, 2013 12:23 am Post subject: Re: PUB/SUB in MB and MQ |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
mbtech wrote: |
when i send a message in input q i.e topic1 alias q its going to only one queue i need to get it in Q1 & Q2 also
Same with the case of Topic2 where it has to come for Q2 & Q3
|
How do you send message to Alias Queue of Topic? Are you sending the messages to the topics? If you are publishing the message to Topic-1, it will be subscribed by the queues which has registered the subscription. Can you please be more clear on your design and doubt? |
|
Back to top |
|
 |
mbtech |
Posted: Thu Feb 14, 2013 12:55 am Post subject: |
|
|
Apprentice
Joined: 18 Jul 2012 Posts: 36
|
Hi
Iam sending it through alias queues pointing to topics when i tested purely on MQ by putting a message in alias queue of topic1 as it is subscribed by both Q1 & Q2 both are receiveing.It is entirely fine in MQ
When i develop a flow for it in mb like
MQIN_ALIAS_TOPIC1
MQIN_ALIAS_TOPIC2
COMPUTE
Q1 Q2 Q3
for TOPIC1 i should get in Q1 & Q2 because they subscribed TOPIC1
for TOPIC2 i should get in Q3 & Q2 because they subscribed TOPIC2
Q2 subscribed both topics
when i send a message to topic am getting in either of Q1 or Q2 not both, which is not the desired output. |
|
Back to top |
|
 |
kash3338 |
Posted: Thu Feb 14, 2013 3:13 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
Still it is not very clear. You have two Topics,
Quote: |
Topic-1 and Topic-2.
Topic-1 Alias Queue: A1
Topic-2 Alias Queue: A2
Topic-1 Subscribers - Q1, Q2
Topic-2 Subscribers - Q2, Q3
|
When you have checked with WMQ by posting messages to A1 and A2, you are able to see the messages subscribed by Q1,Q2 (for A1) and Q2,Q3 (for A2).
Now what are you trying to do in WMB here? |
|
Back to top |
|
 |
mbtech |
Posted: Thu Feb 14, 2013 4:53 am Post subject: |
|
|
Apprentice
Joined: 18 Jul 2012 Posts: 36
|
TOPIC1--SPORTS--ALIAS1Q
TOPIC2--STOCKS--ALIAS2Q
SUBSCRIPTIONS
S1 S2 S2a S3
Sports sports stocks stocks
OUTQ1 SPORTS
OUTQ2 SPORTSNSTOCKS FOR EITHER SPORTS OR
STOCKS IT SHOULD RECEIVE MESSAGEOUTQ3 STOCKS
Iam receiving in only oneq either OUTQ1 or OUTQ2
OR OUTQ2 or OUTQ3
Is it like alias queue cannot send message to multiple queues
[/b] |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Feb 14, 2013 5:11 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Messages are published to a topic.
A single message published to a single topic is delievered once to each subscriber of that topic.
if you have two topics, SPORTS and STOCKS, and four subscribers as you have laid out.
When you publish to SPORTS, one copy of that message will go to each subscriber to SPORTS.
So you have subscribers S1, and S2. One message will be delivered to S1 and one message will be delivered to S2.
When you publish to STOCKS, one copy of that message will go to each subscriber to STOCKS.
You have subscribers S2a and S3. One message will be delivered to S2a and one message will be delivered to S3.
If, somehow, you publish a message to *both* stocks AND sports, then you should see one message at all four subscribers. |
|
Back to top |
|
 |
|