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 Java / JMSNeed advice: MQ base Java, JMS, AMI, or CMI?

Post new topicReply to topic
Need advice: MQ base Java, JMS, AMI, or CMI? View previous topic :: View next topic
Author Message
PaulMraz
PostPosted: Tue Aug 28, 2001 10:26 am Post subject: Reply with quote

Novice

Joined: 27 Aug 2001
Posts: 12

I need to explore pros/cons of what approach to take for my Java interface module (MQI, JMS, AMI, CMI?) for retrieving messages off a queue (yet to be setup & populated) on the NT platform. I'm a Java neophyte (classroom knowledge only), and have only used MQI to write a COBOL module to retrieve MQSeries messages (OS/390) previously. I have explored IBM's MQ website & manuals, but am at a loss at how to decide the best approach. MQI or JMS? or would the AMI be better? How to decide? Client or bindings mode? Is there a FAQ sheet for these type of questions?

Also, I have located the MQ Java classes via the IBM website, but I have not seen sample code that USES those classes to connect, retrieve messages, etc.

Any advice or suggestions would be appreciated!
Back to top
View user's profile Send private message
bduncan
PostPosted: Tue Aug 28, 2001 2:46 pm Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

Paul,
Take a look at the software repository that we host here at http://www.mqseries.net
The link to our Java section is:
http://www.mqseries.net/pafiledb203/pafiledb.php?PHPSESSID=&action=viewcat&id=3

You should find both MQI and JMS examples. You can also look through previous threads in this forum. A good thread exploring the differences between MQI and AMI on Java can be found here:
http://www.mqseries.net/phpBB/viewtopic.php?topic=251&forum=12&3

Here's my take in a nutshell. If you want to do complex manipulation of the headers (like playing with MsgIds, CorrelIds, etc.) or plan on doing such things in the future, then use MQI. If you have lots of developers who are going to be making use of your MQSeries system and don't necessarily know MQSeries, then use AMI to provide them a layer of abstraction.
Always use binding mode when possible. It is much faster, and doesn't require a server connection channel being defined on the queue manager. But sometimes you have no choice. The last time I looked, MA88 (java support pac) for Linux only supported client mode.


_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
PaulMraz
PostPosted: Thu Aug 30, 2001 5:57 am Post subject: Reply with quote

Novice

Joined: 27 Aug 2001
Posts: 12

Brandon, thanks for the information, that was helpful. Any opinions on using JMS as opposed to AMI (or MQI)?

Thanks,
Paul
Back to top
View user's profile Send private message
bduncan
PostPosted: Thu Aug 30, 2001 12:34 pm Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

I look at it this way. If you are leaning towards AMI, you should just use JMS instead. AMI's advantage is that it adds an extra layer of abstraction so your application programmers don't need to know the internals of MQSeries. This is similar to JMS, except that in learning JMS, your application developers can use the same knowledge to use JMS on other messaging systems like MSMQ, Tibco, etc... Whereas when they learn AMI, they can only apply it to systems that use MQSeries. The advantage of AMI is that it is available in many languages (just like MQI) whereas JMS is only in Java. So, if your application developers aren't Java coders, or your business doesn't want to be a Java house, then AMI is the logical choice.
As far as MQI goes, I look at it this way. If you are looking for the most comprehensive interface into MQSeries, being able to interact with it more directly, then MQI is the way to go. It's kinda like C++ versus Java, where MQI is like C++... In C, you can tinker with the system on a very low level, whereas Java is more abstract. However, this adds extra complexity to your C code, whereas Java is easier to read and understand. If you need additional advice on what API to use, I can give you a more detailed explanation, but I'd need to have a better idea of the system you are trying to implement and what your requirements are...


_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
PaulMraz
PostPosted: Thu Aug 30, 2001 1:25 pm Post subject: Reply with quote

Novice

Joined: 27 Aug 2001
Posts: 12

Brandon:

I think the need for the project is to implement the simplest, least complex, most straightforward solution, as this will be a very low-volume, low-complexity application - just fetch messages, do minimum validation of fields, and update oracle database tables. I'm trying to evaluate the different approaches in this context, with the simplest solution as probably optimal.

I've done MQI with COBOL and it was pretty straightforward, but in attempting to learn Java for this implementation, the number of objects and classes looks pretty overwhelming, so if the AMI would simplify things a bit, that was looking appealing.

Someone briefly gave me advice on JMS, that it had its advantages, and we might be able to use JDBC directly from JMS if JMS had a plug-in to Oracle, but that if we were looking for the simplest solution, it might be overkill to go with JMS.

Again, all feedback and advice appreciated!

- Paul
Back to top
View user's profile Send private message
bduncan
PostPosted: Fri Aug 31, 2001 9:21 am Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

Do you have a requirement to do this in Cobol? Or will you consider other languages? Personally, if you are looking for simplicity, I would recommend the object-oriented Perl API... You can develop MQSeries code this way faster than any other method as far as I'm concerned...


_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
PaulMraz
PostPosted: Tue Sep 04, 2001 11:04 am Post subject: Reply with quote

Novice

Joined: 27 Aug 2001
Posts: 12

Brandon:

No, the requirement is to do the (receive message) interface module in Java. Hence, I'm trying to determine if JMS is as simple as using the MQSeries AMI API with associated Java classes. If JMS is more complex, I need to determine what advantages JMS would offer, as well as how much more complex. And I'm assuming that whatever method is used to extract the message data, JDBC should probably be used to update the target Oracle database tables?

Thanks,
Paul
Back to top
View user's profile Send private message
bduncan
PostPosted: Tue Sep 04, 2001 4:27 pm Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

Paul,
If you want to gauge how a similarly functioning program is written in both the MQI Java API and the JMS API, compare the following two programs, found in our code repository:

http://www.mqseries.net/pafiledb203/pafiledb.php?PHPSESSID=&action=viewfile&fid=18&id=3

http://www.mqseries.net/pafiledb203/pafiledb.php?PHPSESSID=&action=viewfile&fid=27&id=3

The first shows how to do syncpointing with MQI, and the second in JMS. As far as an accompanying AMI program, I don't have one, but as a general rule of thumb AMI calls look more like JMS than MQI.

And yes, you can use JDBC to connect to your database. This is independent of your choice of interface into MQSeries.


_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
PaulMraz
PostPosted: Wed Sep 05, 2001 6:15 am Post subject: Reply with quote

Novice

Joined: 27 Aug 2001
Posts: 12

Brandon, yes, thanks, I had browsed those samples. From a cursory glance of those, it did not appear that the JMS code was any simpler than the native Java MQ code sample (the JMS code was actually longer). It's hard for me to determine; the JMS does not appear simpler to me, at least at this point...

I'd really like to view some AMI Java sample code; the MQSeries Application Interface Manual on the website does not display any such samples, only references where they are in the directory structure once AMI is installed, and how to run those samples, subsequently.

Anyone know of any websites with sample AMI Java code?

Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ Java / JMSNeed advice: MQ base Java, JMS, AMI, or CMI?
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.