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 Index » IBM MQ Java / JMS » MQSeries - sending messages from one MQ queue to another

Post new topic  Reply to topic Goto page 1, 2  Next
 MQSeries - sending messages from one MQ queue to another « View previous topic :: View next topic » 
Author Message
muhilan
PostPosted: Fri Aug 29, 2008 12:40 pm    Post subject: MQSeries - sending messages from one MQ queue to another Reply with quote

Novice

Joined: 29 Aug 2008
Posts: 11

I am new to JMS and MQSeries. I wish to write a subscription module in which the code would take messages from one queue and send it to various queues. The queue is read in subscription mode. The requester queues that receive the messages would need to send a response back to the message-originating queue.

Thanks in advance
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Aug 29, 2008 6:35 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

I would suggest that you read up on pub/sub and visit a tutorial. Sun has a good one. You have all your terms and key words confused.
If you can "talk the talk" you obviously can't "walk the walk" yet.

Studying a good tutorial for JMS will be your next step to get there.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
muhilan
PostPosted: Sat Aug 30, 2008 7:07 am    Post subject: point-to-point or publish/subscribe with one to many Reply with quote

Novice

Joined: 29 Aug 2008
Posts: 11

hi
thanks for the direction. My apologies for being naive. After a glance at the Sun tutorial I see that my problem could be about using the publish-subscribe model (one to many).

Still not sure though, if I am getting my terms right!!
thanks
Back to top
View user's profile Send private message
zpat
PostPosted: Sat Aug 30, 2008 8:07 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

You want a simple fan out app.

Unless you really need the flexibility of pub sub then just code a little app to GET messages from one queue and PUT them to more than one queue (either repeat the PUT or use a Distribution List).

No need to over-complicate things!
Back to top
View user's profile Send private message
muhilan
PostPosted: Sat Aug 30, 2008 7:28 pm    Post subject: app to GET messages from one queue and PUT them to more.. Reply with quote

Novice

Joined: 29 Aug 2008
Posts: 11

If I want to code "a little app to GET messages from one queue and PUT them to more than one queue (either repeat the PUT or use a Distribution List)" is there any sample app that I can develop upon?

thanks again
Back to top
View user's profile Send private message
zpat
PostPosted: Sun Aug 31, 2008 9:15 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

MQCONN queuemanager
MQOPEN input queue
MQOPEN output queue1
MQOPEN output queue2 etc

MQGET input queue
MQPUT output queue1
MQPUT output queue2 etc
Repeat until MQRC 2033 on the MQGET

MQCLOSE input queue
MQCLOSE output queue1
MQCLOSE output queue2
MQDISC

It's that easy. You could add syncpointing to ensure consistency. Plus of course the usual error handling.

There are some IBM JMS samples, search this site to the find the URL.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Aug 31, 2008 9:51 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

zpat wrote:
MQCONN queuemanager
MQOPEN input queue
MQOPEN output queue1
MQOPEN output queue2 etc

MQGET input queue
MQPUT output queue1
MQPUT output queue2 etc
Repeat until MQRC 2033 on the MQGET

MQCLOSE input queue
MQCLOSE output queue1
MQCLOSE output queue2
MQDISC

It's that easy. You could add syncpointing to ensure consistency. Plus of course the usual error handling.

There are some IBM JMS samples, search this site to the find the URL.


And please note that zpat gave you the basics for java "base" programming.
JMS is a different animal and much more provider independent.
You were right with the pub/sub model.
To ease your "pain" you should start with point to point (P2P) and use a producer and a consumer. Be aware that transactionality is handled at the session level. There are excellent sample programs but going through the tutorial first will give you a good grasp of the concepts instead of just having you code stuff without knowing why...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Sun Aug 31, 2008 10:11 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fjb_saper wrote:
zpat wrote:
MQCONN queuemanager
MQOPEN input queue
MQOPEN output queue1
MQOPEN output queue2 etc

MQGET input queue
MQPUT output queue1
MQPUT output queue2 etc
Repeat until MQRC 2033 on the MQGET

MQCLOSE input queue
MQCLOSE output queue1
MQCLOSE output queue2
MQDISC

It's that easy. You could add syncpointing to ensure consistency. Plus of course the usual error handling.

There are some IBM JMS samples, search this site to the find the URL.


And please note that zpat gave you the basics for java "base" programming.


No, actually, he didn't. That's the basis for the PROCEDURAL MQ API, which is not actually available in Java, since Java is a purely object oriented language.

http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/ja10990_.htm
Back to top
View user's profile Send private message
muhilan
PostPosted: Sun Aug 31, 2008 10:27 am    Post subject: what should be the environment? Reply with quote

Novice

Joined: 29 Aug 2008
Posts: 11

I have installed WebSphere Application Server V6 for Windows.
I am also trying to install WebSphere MQ (to act as a JMS Provider..)and Rational Application Developer as well.

In order to use the PROCEDURAL MQ API, WebSphere MQ Java, what is the recommended software environment that I need to have before developing.
Back to top
View user's profile Send private message
zpat
PostPosted: Sun Aug 31, 2008 12:17 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

AFAIK the JMS wrapper simply maps to MQI calls.

The underlying MQI operations have to take place, no matter what fancy names you give to them. More importantly they must be understood by any MQ developer.

Seems to me that recommending pub/sub to someone who perhaps doesn't understand basic MQ concepts is like taking a first driving lesson in a racing car - not the best idea.
Back to top
View user's profile Send private message
muhilan
PostPosted: Sun Aug 31, 2008 1:45 pm    Post subject: realize this is not easy Reply with quote

Novice

Joined: 29 Aug 2008
Posts: 11

I admit I did not know even basic JMS until I studied up the basic JMS API concepts.

Admitted the whole thing is frustrating for an expert to try and explain things to a newbie, but I am determined to get my feet wet without too much help-taking.

Thanks again
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Aug 31, 2008 8:23 pm    Post subject: Re: realize this is not easy Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

muhilan wrote:
I admit I did not know even basic JMS until I studied up the basic JMS API concepts.

Admitted the whole thing is frustrating for an expert to try and explain things to a newbie, but I am determined to get my feet wet without too much help-taking.

Thanks again

Form his first post he is clearly going the JMS route.
So let him get a good grasp on the JMS API and how to use it first.
Little steps my friend.
ConnectionFactory, Connection, Session, Consumer | Producer
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
muhilan
PostPosted: Mon Sep 01, 2008 6:35 am    Post subject: which Java Message Service Specification version? Reply with quote

Novice

Joined: 29 Aug 2008
Posts: 11

Which version of JMS should I use. On the Sun Website they have Java Message Service Specification - version 1.1 on http://java.sun.com/products/jms/docs.html

I have Java 6 and the GlassFish server on my PC.

Please advise on: Appropriate JMS version for my current Java environment.

thanks
Back to top
View user's profile Send private message
muhilan
PostPosted: Mon Sep 01, 2008 10:32 am    Post subject: Re: realize this is not easy Reply with quote

Novice

Joined: 29 Aug 2008
Posts: 11

fjb_saper wrote:

Form his first post he is clearly going the JMS route.
So let him get a good grasp on the JMS API and how to use it first.
Little steps my friend.
ConnectionFactory, Connection, Session, Consumer | Producer


I got my GlassFish server running. I think there is some JMS version bundled in GlassFish (and I think it is 1.1 .) Not 100%sure. I figured out that I have to create a ConnectionFactory that can do both publish/subscribe tasks. I also need to implement the onMessage method in an MDB..

I am going to try and see if this thing works.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Sep 01, 2008 3:03 pm    Post subject: Re: realize this is not easy Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

muhilan wrote:
fjb_saper wrote:

From his first post he is clearly going the JMS route.
So let him get a good grasp on the JMS API and how to use it first.
Little steps my friend.
ConnectionFactory, Connection, Session, Consumer | Producer


I got my GlassFish server running. I think there is some JMS version bundled in GlassFish (and I think it is 1.1 .) Not 100%sure. I figured out that I have to create a ConnectionFactory that can do both publish/subscribe tasks. I also need to implement the onMessage method in an MDB..

I am going to try and see if this thing works.

Once you have achieved this with standard JMS (Sun) you can look into reading the Using Java manual. For JNDI provider may I suggest the FileSystem provider (It is one of the sun.com.jndi.RefFS* delivered with MQ). All you need to do now is reference correctly the MQ JNDI file and have all MQ jars on the classpath. We recommend at least an MQ client installation. You can then switch the standard JMS provider to MQ.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » MQSeries - sending messages from one MQ queue to another
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.