Author |
Message
|
walterA |
Posted: Thu Dec 17, 2015 8:05 pm Post subject: |
|
|
Novice
Joined: 22 Sep 2015 Posts: 20
|
But still as an option to alias Q and pub-sub I can implement a router that distributes/broadcasts messages to the destination queues. It can use a dynamic routing table to determine recipients. In this case I have more control on the routing algorithm. E.g. I can introduce some additional business logic. Also, I can preserve MQMD in this case.
Here is an example: http://www.enterpriseintegrationpatterns.com/patterns/messaging/RecipientList.html
What do you think? |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 18, 2015 5:53 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
walterA wrote: |
What do you think? |
A couple of things. - That this is one of the main advantages/use cases of an ESB
- That you still haven't explained anything about your actual requirement or why you are trying to do it using pub/sub.
_________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
walterA |
Posted: Fri Dec 18, 2015 8:23 pm Post subject: |
|
|
Novice
Joined: 22 Sep 2015 Posts: 20
|
mqjeff wrote: |
walterA wrote: |
What do you think? |
A couple of things. - That you still haven't explained anything about your actual requirement or why you are trying to do it using pub/sub.
|
because there might be different and new consumers of the messages withing the company (e.g. different departments).
BTW, one more argument towards custom router/distribution list component is that it can route messages based on message body |
|
Back to top |
|
 |
smdavies99 |
Posted: Sat Dec 19, 2015 11:00 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
walterA wrote: |
BTW, one more argument towards custom router/distribution list component is that it can route messages based on message body |
And just what would that give you over a PROPERLY designed Pub.Sub Topic Hierarchy?
This is perfect for distribution content to a variety of subscribers. A department based hierarchy is perfect for this. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Dec 21, 2015 3:20 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Publish/Subscribe doesn't care how many subscribers join or leave at any time.
A well designed topic hierarchy can avoid any need for content based routing. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
walterA |
Posted: Fri Dec 25, 2015 4:20 pm Post subject: |
|
|
Novice
Joined: 22 Sep 2015 Posts: 20
|
Can someone help me with this question in case of Alias Queue approach.
Imagine the external system publishes some messages. They will go to the alias Q then to the topic and then to subscribers. How does MQ know that it needs to forward a message to a specific subscriber. Imagine, the external system publishes a messages "Apple" to the remote alias Queue. Now it needs to flow to the right "Fruit" subscription. So how does it match "apple" message with the "fruit" subscription?
Thank you |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 25, 2015 4:51 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
That's because if you have the right topic hierarchy you will have published to
harvest/fruit/apple and subscribed to harvest/fruit/#
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
walterA |
Posted: Fri Dec 25, 2015 7:24 pm Post subject: |
|
|
Novice
Joined: 22 Sep 2015 Posts: 20
|
fjb_saper wrote: |
That's because if you have the right topic hierarchy you will have published to
harvest/fruit/apple and subscribed to harvest/fruit/#
Have fun  |
But how message "apple" will be published to harvest/fruit/apple? What properties do I need to setup on the message to make it happen? Does the external system needs to setup some property on the message, e.g. subject="apple" ? |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Dec 25, 2015 11:47 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
walterA wrote: |
But how message "apple" will be published to harvest/fruit/apple? What properties do I need to setup on the message to make it happen? Does the external system needs to setup some property on the message, e.g. subject="apple" ? |
Why have you not tried some of the suggestions? Then you could have found out for yourself how a pub/sub topic hierarchy works. You can do a simple test using JUST the MQ Explorer.
There is no better learning than trying it for yourself.
go on give it a go. It won't suddenly rear up out of the computer screen and bite you. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
walterA |
Posted: Sat Dec 26, 2015 10:34 am Post subject: |
|
|
Novice
Joined: 22 Sep 2015 Posts: 20
|
smdavies99 wrote: |
Why have you not tried some of the suggestions? Then you could have found out for yourself how a pub/sub topic hierarchy works. You can do a simple test using JUST the MQ Explorer.
There is no better learning than trying it for yourself.
go on give it a go. It won't suddenly rear up out of the computer screen and bite you. |
Yes, I am definitely going to try this, but I am trying to understand the theory first. I need to understand how to specify that this message is of "apple" type when sending it... Can someone explain this to me? or maybe point out to the documentation?
Thank you |
|
Back to top |
|
 |
walterA |
Posted: Sat Dec 26, 2015 11:17 am Post subject: |
|
|
Novice
Joined: 22 Sep 2015 Posts: 20
|
what I am trying to say is that the external system will always publish messages to the alias Q associated with the root topic. But I want the internal consumers to be able to subscribe to specific types of messages, e.g. only apples. And I don't understand how to do this.... |
|
Back to top |
|
 |
bruce2359 |
Posted: Sat Dec 26, 2015 11:21 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
|
Back to top |
|
 |
walterA |
Posted: Sat Dec 26, 2015 12:55 pm Post subject: |
|
|
Novice
Joined: 22 Sep 2015 Posts: 20
|
Ok, I see.. thank you so much for the link to the presentations. I did read of them.
In my cases the publishing application will be sending messages to the alias Q that will be mapped to the topic, so it will always publish message to the root. So there is no way to have a topic tree and allow clients to subscribe only to specific types of messages based on tree hierarchy.
The only way is to use selectors. i.e. the publishing application will add a message property, something like "message.type". Then the subscriber can use selectors to get only messages of specific type.
Correct me if i am wrong. |
|
Back to top |
|
 |
bruce2359 |
Posted: Sat Dec 26, 2015 6:07 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
If you are publishing about apples to apples topic, there is no need to set message properties on a message to indicate that the subject is apples.
If you subscribe to apples, then you will receive apple pubs. If you subscribe further up the hierarchy, you will (or may) receive other fruit pubs. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
bruce2359 |
Posted: Sun Dec 27, 2015 1:17 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
walterA wrote: |
In my cases ... it will always publish message to the root. |
Why? What is your purpose of publishing to the topic root - rather than publishing to apples, if the pub is about apples?
walterA wrote: |
So there is no way to have a topic tree and allow clients to subscribe only to specific types of messages based on tree hierarchy. |
No, not correct.
Clients subscribe to whichever node in the tree they are interested in. A client can subscribe to fruit, if it is interested in lower-level topics - like apples, oranges, b a n a n a s, ... Or the app can subscribe to just apples. If apples has lower nodes, the app can subscribe to grannysmith, or fuji or whatever types of apples exist in the tree.
walterA wrote: |
The only way is to use selectors. i.e. the publishing application will add a message property, something like "message.type". Then the subscriber can use selectors to get only messages of specific type.
|
Selectors are a choice - one that makes little sense as I understand your business requirement so far.
Please reread the URLs I offered above. The 2nd URL offered C programming language examples of both publishing and subscribing apps. Note the # wild-card symbol. Note also ASPARENT topic attributes. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
|