Author |
Message
|
Henry70 |
Posted: Tue Nov 10, 2009 1:23 am Post subject: Publish/Subscribe |
|
|
Newbie
Joined: 10 Nov 2009 Posts: 2
|
Can someone please tell me what I am doing wrong.
I am making a publication in a MQ 6 environment, this publication is sent to a PubSub queue in a MQ7 environment. a Subscription is being made based on a selector string color=zwart and a topic "/prijzen/fruit/appels".
Below is trace of the message that was composed in the MQ 6 environment:
(0x01000000):MQRFH2 = (
(0x03000000):Version = 2
(
(0x01000000):Version = (
(0x02000000): = 2
)
(0x01000000):Format = (
(0x02000000): = 'MQHRF2 '
)
(0x01000000):Encoding = (
(0x02000000): = 546
)
(0x01000000):CodedCharSetId = (
(0x02000000): = 437
)
(0x01000000):Flags = (
(0x02000000): = 0
)
(0x01000000):NameValueCCSID = (
(0x02000000): = 437
)
)
(0x03000000):Format = ' '
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Flags = 0
(0x03000000):NameValueCCSID = 1208
(0x01000000):mcd = (
(0x02000000): = ''
(0x01000000):Msd = (
(0x02000000): = 'xmlnsc'
)
)
(0x01000000):usr = (
(0x02000000): = ''
(0x01000000):color = (
(0x02000000): = 'zwart'
)
)
(0x01000000):psc = (
(0x01000000):Command = (
(0x02000000): = 'Publish'
)
(0x01000000):Topic = (
(0x02000000): = '/prijzen/fruit/appels'
)
)
)
The problem is that the subscription based on the selector string is not working. For instance the subscribers dont receive messages with color=zwart
Last edited by Henry70 on Tue Nov 10, 2009 1:44 am; edited 1 time in total |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Tue Nov 10, 2009 1:40 am Post subject: Re: Publish/Subscribe |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
Henry70 wrote: |
Can someone please tell me what I am doing wrong.
|
Not providing any information as to what the problem is, if indeed there is one. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Tue Nov 10, 2009 1:54 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
How are you forming the usr folder? The empty string element looks a little wrong and while it may not be the root cause of your issue i'd look at fixing it.
How is the client specifying the selector? Can you share the code?
Can you see the published message waiting to be received? |
|
Back to top |
|
 |
Henry70 |
Posted: Tue Nov 10, 2009 5:09 am Post subject: reply to WMBDEV1 |
|
|
Newbie
Joined: 10 Nov 2009 Posts: 2
|
How are you forming the usr folder? The empty string element looks a little wrong and while it may not be the root cause of your issue i'd look at fixing it.
Whe have a channel exit between the MQ v6 qmgr and MQ v6 qmgr to log the messages. The message body looks like this:
RFH ¸"µ ¸L<psc><Command>Publish</Command><Topic>/prijzen/fruit/appels</Topic></psc> <usr><color>zwart</color></usr> <mcd><Msd>xmlnsc</Msd></mcd><Body>my message data</Body>
How is the client specifying the selector? Can you share the code?
“The client” is a message flow, which puts a message to a MQ v6 remote queue. The remote queue is defined:
dis qr(ESB.PUB.STREAM)
3 : dis qr(ESB.PUB.STREAM)
AMQ8409: Display Queue details.
QUEUE(ESB.PUB.STREAM) TYPE(QREMOTE)
ALTDATE(2009-10-29) ALTTIME(10.47.25)
CLUSNL( ) CLUSTER( )
CLWLPRTY(0) CLWLRANK(0)
DEFBIND(OPEN) DEFPRTY(4)
DEFPSIST(NO) DESCR( )
PUT(ENABLED) RQMNAME(APOPS001)
RNAME(SYSTEM.BROKER.DEFAULT.STREAM) SCOPE(QMGR)
XMITQ( )
Queuemanager APOPS001 (MQv7) receives publications on queue SYSTEM.BROKER.DEFAULT.STREAM.
The message flow is using the <usr> folder to specify the message properties on which the selector in the subscription should act.
SET OutputRoot.MQRFH2. (MQRFH2.Field).Version = InputRoot.MQMD.Version;
SET OutputRoot.MQRFH2. (MQRFH2.Field).Format = InputRoot.MQMD.Format;
SET OutputRoot.MQRFH2. (MQRFH2.Field).Encoding = InputRoot.MQMD.Encoding;
SET OutputRoot.MQRFH2. (MQRFH2.Field).CodedCharSetId = InputRoot.MQMD.CodedCharSetId;
SET OutputRoot.MQRFH2. (MQRFH2.Field).Flags = InputRoot.MQMD.MsgFlags;
SET OutputRoot.MQRFH2. (MQRFH2.Field).NameValueCCSID = InputRoot.MQMD.CodedCharSetId;
-- Publish
SET OutputRoot.MQRFH2.psc.Command = 'Publish';
SET OutputRoot.MQRFH2.psc.Topic = InputRoot.XMLNSC.*:Envelope.*:Header.th:TopicHeader.th:Topic.th:TopicName;
CREATE LASTCHILD OF OutputRoot.MQRFH2.usr.color VALUE InputRoot.XMLNSC.*:Envelope.*:Header.th:TopicHeader.th:Identifiers.th:Identifier.color;
Can you see the published message waiting to be received?
There are multiple subscriptions on this topic (/prijzen/fruit/appels).
The “base” subscription is not using any selectors.
The other subscriptions on /prijzen/fruit/appels all have different selectors, based on the variable “color”. E.g. color=white, color=zwart etc.
The publication gets published to the “base” subscription (which has no selectors). Therefore, the message selector which acts on the message properties in the <usr> folder does not work. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Nov 10, 2009 12:44 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Well .... it all depends....
I would have expected to see a topic like prijzen/fruit/appels/rot
and prijzen/fruit/appels/zwart etc...
By having the color part of the topic and not an attribute on the message you can subscribe to prijzen/fruit/appels/<color> or to prijzen/fruit/appels# which will give you the level above with all publications at sublevels...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|