| Author | 
		  Message
		 | 
		
		  | sirish | 
		  
		    
			  
				 Posted: Mon Jan 22, 2007 3:01 am    Post subject: Format of Publish/Subscribe commands | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 11 Jan 2007 Posts: 4
  
  | 
		  
		    
			  
				Hi,
 
         My question is with regard to the format of the Publish/Subscribe messages that are generated. This is more to do with things that happen behind the scenes. Here are the steps that i followed 
 
 
 
Setup : I have Websphere MQ v 6.0 with refresh pack for 6.0.1.0 installed. (The refresh pack would allow me to view the Topics if any in the MQ explorer)
 
 
Step 1: Open Web sphere MQ explorer
 
 
Step 2: Created a queue manager i.e TestQueueManager
 
 
Step 3: Created a local queue i.e TestQueue
 
 
Step 3: Started the broker on this queue manager using the following command
 
 
strmqbrk -m TestQueueManager
 
 
Step 4: Registered a publisher for the topic TestTopic by right clicking on the Topics icon and selecting the option in the pop up menu (this would create a TestTopic entry under the Topics folder)
 
 
Step 5: Registered a subsciber for the same topic (TestTopic) using the option "Register subscriber" in the pop up menu as before. In this case i gave TestQueue as the delivery queue name
 
 
 
Step 6: I tested the publication by using the "Test publisher" option. This would post a message to the topic TestTopic which the broker would deliver to the subscriber and the message would be made available on the queue TestQueue 
 
 
 
Behind the scenes, this is what is happening.
 
 
The publisher would be generating a Publish message in MQRFH format would be sending this to the Default stream of the broker. The broker would interpret this and would forward the message to the registered susbcriber.
 
 
Now i want to do this programmatically. In other words, I know how to connect to queues using the Websphere classes for base java (MQMessage, MQQueueManager etc). Now if i can create a publish message in the required format then it would involve just sending this messsage to the broker. 
 
 
And that's where i am stuck and would need inputs. 
 
 
Thanks
 
 
PS: I am staying away from the JMS publish/subscribe as of now. I want to get my hands dirty with some low level programming and hence the query | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Mon Jan 22, 2007 3:11 am    Post subject: Re: Format of Publish/Subscribe commands | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| sirish wrote: | 
   
  
	Now i want to do this programmatically. In other words, I know how to connect to queues using the Websphere classes for base java (MQMessage, MQQueueManager etc). Now if i can create a publish message in the required format then it would involve just sending this messsage to the broker. 
 
 | 
   
 
 
 
There's a section in the Publish / Subscribe manual called "Writing applications" that discusses this and related topics in some detail. 
 
 
But it sounds like you're on the right track (<psc> section of an RFH2 sent to the broker control queue).
 
 
Do you have a specific problem the manual doesn't seem to answer? _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | sirish | 
		  
		    
			  
				 Posted: Mon Jan 22, 2007 8:24 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 11 Jan 2007 Posts: 4
  
  | 
		  
		    
			  
				Hi again,
 
       Well i have gone through the manual and still was not clear about the exact format.
 
 
         The MQRFH2 format would be supported by Websphere Message Broker. With regard to the broker running on MQ, i guess it should be in MQRFH1 format. I therefore needed inputs in this directions
 
 
Thanks a bunch in advance
 
Sirish | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Tue Jan 23, 2007 2:58 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Poobah
 
 Joined: 16 Oct 2002 Posts: 19981
  
  | 
		  
		    
			  
				The MQ Using Publish/Subscribe manual does discuss the format of the MQRFH header.  The WMB pub/sub manual discusses the format of the MQRFH2 header.
 
 
The pub/sub samples that come with MQ use the MQRFH header. _________________ I am *not* the model of the modern major general. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Tue Jan 23, 2007 3:43 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				
   
	| sirish wrote: | 
   
  
	| I know how to connect to queues using the Websphere classes for base java (MQMessage, MQQueueManager etc | 
   
 
 
Now if you just learn how to use the JMS API you'll be saving yourself a world of hurt in pub/sub. 
 
 
The JMS API is specially geared towards supporting the pub/sub model.
 
 
Enjoy    _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mvic | 
		  
		    
			  
				 Posted: Tue Jan 23, 2007 5:47 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi
 
 Joined: 09 Mar 2004 Posts: 2080
  
  | 
		  
		    
			  
				
   
	| fjb_saper wrote: | 
   
  
	| The JMS API is specially geared towards supporting the pub/sub model. | 
   
 
 
Also the XMS client libraries will allow you to work more easily with pub/sub in C, C++, .NET. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |