ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexIBM MQ API SupportPublish/Subscribe

Post new topicReply to topic
Publish/Subscribe View previous topic :: View next topic
Author Message
Henry70
PostPosted: Tue Nov 10, 2009 1:23 am Post subject: Publish/Subscribe Reply with quote

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
View user's profile Send private message
WMBDEV1
PostPosted: Tue Nov 10, 2009 1:40 am Post subject: Re: Publish/Subscribe Reply with quote

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
View user's profile Send private message
WMBDEV1
PostPosted: Tue Nov 10, 2009 1:54 am Post subject: Reply with quote

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
View user's profile Send private message
Henry70
PostPosted: Tue Nov 10, 2009 5:09 am Post subject: reply to WMBDEV1 Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Nov 10, 2009 12:44 pm Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ API SupportPublish/Subscribe
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.