Publish/Subscribe architecture is useful in scenarios where P2P might not be suitable, reasons are obvious :
Exception Scenario :
While subscribing, we may get following warning :
- Problems with large numbers of senders & receivers.
- Problems when senders & receivers change frequently; (Becomes unmanageable)
- MQ based subscription messages registered using a special queue SYSTEM.BROKER.CONTROL.QUEUE.
- Do not need to define a queue to handle subscription requests.
- Publication messages handled within the flow.
- Publication node receives publication messages and distributes to the subscribers matching the topic within the publication message.
Subscriber Flow
MQINPUT ->> COMPUTE ->> MQOUTPUT (SYSTEM.BROKER.CONTROL.QUEUE)
Code for Compute Node :
CALL CopyEntireMessage();
SET OutputRoot.MQRFH2.psc.Command = 'RegSub'; --RegSub is a keyword
SET OutputRoot.MQRFH2.psc.Topic = 'SPORTS'; --TopicName
SET OutputRoot.MQRFH2.psc.QName = 'DATA'; -- QueueName
SET OutputRoot.MQRFH2.psc.QMgrName = 'QM'; -- QueueManagerName
Declare PTR REFERENCE to OutputRoot.MQRFH2;
Detach PTR;
Publisher Flow
MQINPUT ->> COMPUTE ->> PUBLICATION NODE
Code for Compute Node :
CALL CopyEntireMessage();
SET OutputRoot.MQRFH2.psc.Command = 'Publish'; -- Publish is a keyword
SET OutputRoot.MQRFH2.psc.Topic = 'SPORTS'; --TopicName
Declare PTR REFERENCE to OutputRoot.MQRFH2;
Detach PTR;
attach PTR TO OutputRoot.MQMD AS NEXTSIBLING ;
RETURN TRUE;
OR
OR
Exception Scenario :
While subscribing, we may get following warning :
And no subscription happens. I solved this issue by having the logged user name less then 12 chars, we can also see : http://www.mqseries.net/phpBB2/viewtopic.php?t=1056&highlight=2035+sid
Hi Harish,
ReplyDeleteThanks for publishing this topic on your blog !
After publishing a message in the input queue 'PUB.IN', I assume the message gets published in the topic 'SPORTS'. How does the subscriber flow pick the message from the topic ? Is there any configuration that has to be done in the Message broker Explorer ?
Also, Do I need to create a queue called 'STARTER' for the subscriber flow ? If so what is the input for this ?
ReplyDeleteHey Shiva, First of all you have to subscribe to a particular topic, in the given example it is "SPORTS" , so you need to trigger this(Subscriber) flow with any input (Idea is to subscribe it that all). Once you do this then trigger the Publisher flow, you will get whatever been posted in PUB.IN queue into "DATA" queue.
ReplyDeleteSee this:
SET OutputRoot.MQRFH2.psc.QName = 'DATA'; -- QueueName
Hoping this would be useful for you...
Thanks for your reply Harish.
ReplyDeleteI've got one more question regarding guaranteed delivery to the subscribers.
Suppose I have a topic: Stocks_abc
Subscribers: Queue1 and Queue2
Scene 1: Both queues are up - When I put a message on the topic, both the queues receives the message.
Scene 2: If Queue1 is down and Queue2 is up - When I put a message on the topic, only Queue2 receives the message. Later when I bring Queue1 up, my requirement is it should receive the message or I should be notified it didn't reach the queue.
Any idea on this ??
Hi Harish
ReplyDeleteThank you for a good and very needed blog. I have been investigating reg. the same concept since couple of weeks. There are very few blogs out there on WMB 7.0 pub/sub. This fits my need perfectly. I would greatly appreciate if you can answer my below questions.
1. May I know which version of WMQ you are using here. Does these message flows work with WMQ 7.0 and WMB 7.0?
2. Does Subscriber flow in this blog create an entry in WMQ Subscriptions ? If not what does it do. Before triggering the publication flow, I want to confirm that the subscription has been happened successfully. How can I do this.
3. I also have a need to create a topic in the message flow. Is it possible. If so, can you please describe the flow in detail.
Thank You again for very good and detailed blog.
Hi Harish
ReplyDeleteI would greatly appreciate if you can answer above 3 questions ASAP. Thank You again.
Hi Hyndhavi,
ReplyDeletePlease find my comments:
1. May I know which version of WMQ you are using here. Does these message flows work with WMQ 7.0 and WMB 7.0?
[Harish] : It is 7.0 & yes it will work.
2. Does Subscriber flow in this blog create an entry in WMQ Subscriptions ? If not what does it do. Before triggering the publication flow, I want to confirm that the subscription has been happened successfully. How can I do this.
[Harish] : Yes it creates subscription in WMQ.
Steps to see the subscription :
a) Open MQ 7.0.. & see subscriptions under queue Manager tab.
b) You can see Subscription name, Topic name, Topic string etc.
c) Topic string is "SPORTS" as I have used in above example.
3. I also have a need to create a topic in the message flow. Is it possible. If so, can you please describe the flow in detail.
[Harish] : On basis of my little knowledge on WMB, I do not think you can create a topic in flow, topics are subject to be configured in MQ.
Hi
ReplyDeletePresently we are using wmb v6.1 pub-sub is at broker level, in our one of application subscriber is not able to receive messages.
Publish flow executed successfully. How to find in this case if flow is subscribed successfully or not.
It 's an amazing and awsome blog Thanks for sharing
ReplyDeleteOracle SOA Online Training
azure networking
ReplyDeletearm templates
azure notification hub
azure bastion host
app power bi
kubernetes dashboard
terraform cheat sheet
aws inspector
ReplyDeleteopenshift vs kubernetes
azure data lake
arm templates
azure traffic manager
azure bastion
azure synapse analytics
openshift certification
ReplyDeleteazure data engineer certification
aws solution architect training
azure solution architect certification
cloudkeeda
ReplyDeletewhat is azure
azure free account
cloudkeeda
cloudkeeda
cloudkeeda
cloudkeeda
cloudkeeda
"ebs on oci free guide
ReplyDeleteEBS R12 to Cloud For Beginners
oracle integration cloud services
az-303 questions
AWS Certified Solutions Architect For Beginners
AWS Solutions Architect Interview Questions
aws certified solutions architect - associate q&a
AWS Certified Solutions Architect Free training
da 100 examination questions
Power BI Data Analyst Certification For Beginners
Docker & CKA free training
Guide for Kubernetes Admin"
The post was engaging, informative, and well-written. The author did an excellent job of breaking down a complex topic into easily digestible and understandable sections. The writing style was clear and concise, which made it easy to follow along and stay engaged throughout. If you are searching Android app development company in india which can give you fast delivery on app development then you are reading the right comment.
ReplyDeleteElevate your email marketing with our expert Mailwizz services. Unlock efficient campaigns and superior deliverability today.
ReplyDeleteOptimize your website with expert CPanel Server Management solutions. Ensure smooth performance and security with our services.
ReplyDeleteHow to Sign Up for YouTube with a Brazil Virtual Number from PVApins (2024): You can create a YouTube account using any email provider (e.g., Hotmail) without needing Gmail. During signup, choose "Create an account for yourself" and use your existing email. For phone verification, visit PVApins.com, add $1.60 to your balance, and purchase a Brazil virtual number. Use this number on YouTube during registration, then retrieve the verification code from PVApins. Enter the code on YouTube to complete the process.
ReplyDeletevisit us : https://pvapins.com/?/EN