Operating System - OpenVMS
1748051 Members
5195 Online
108757 Solutions
New Discussion юеВ

Re: Using JMS from C under OpenVMS

 

Using JMS from C under OpenVMS

Hello

I've been asked to develop an interface of an existing C-application under OpenVMS with JMS. Does anybody have experience in doing so, or tell me where I can find code examples for this?
I have little to no experience in Java programming, so I would prefer a possibility to access JMS directly via C. Are there any libraries (available for OpenVMS !!!) which can do the job?

Thanks in advance for your help

J├╢rg
3 REPLIES 3
Jonathan Cronin
Advisor

Re: Using JMS from C under OpenVMS

Hi,

JMS is not, per se, a messaging service, but an API facade for various vendor implementations of messaging.These all (that I know of) provide a direct C API. The advantage of JMS is that is is vendor independent.

If you don't need the vendor-independence, I'd find out the underlying messaging service (MQSeries etc) and use the C API. If you have to use JMS, then you have to use JNI (Java Native Interface) to call the Java methods from C.
Some of the message vendors provide this (a JMS like C API) in addition to the "native" C API. I believe there are some open-source C -> JMS JNI wrappers out there, too. Google "JMS C interface".

An alternative is do the JMS processing in a separate process (or indeed on a separate host) and implement a socket based interface. If you are just connecting to a specific queue or pair of queues (for send and receive) this is pretty simple. If you have to use the full JMS API with dynamically created queues and message selection etc then this is more work than the other solutions.

Jonathan


Craig A Berry
Honored Contributor

Re: Using JMS from C under OpenVMS

If if comes to using JNI, don't neglect the example that came with your SDK. It comes as a BACKUP save set and is located somewhere similar to the following, depending on Java version:

$ dir SYS$COMMON:[JAVA$150.VMS_DEMO]JNI_EXAMPLE.SAV

Directory SYS$COMMON:[JAVA$150.VMS_DEMO]

JNI_EXAMPLE.SAV;1

Total of 1 file.

Re: Using JMS from C under OpenVMS

Meanwhile, our customer has canceled the project. Nevertheless, thanks to everybody.