cancel
Showing results for 
Search instead for 
Did you mean: 

How to access a remote JMS queue from a client program?

Former Member
0 Kudos

On system X (with SAP XI and Web AS server installed) messages are written to a JMS queue. Connection factories, queues etc. are defined and created only on system X.

Now I want to access this JMS queue from a client program running on another system Y (where both SAP Netweaver Developer Studio and Web AS are installed).

What must I do in order that the client program on system Y can access the queue on system X? Do I have to create a connection factory and a queue on system Y though I want to access those on system X? Are there written instructions and example Java programs for this scenario?

Accepted Solutions (0)

Answers (1)

Answers (1)

sabine_heider
Explorer
0 Kudos

Hi Leendert,

do you want to use the JMS API directly? In this case you have to create the connection factory on system X. From system Y, you access the JNDI on system X and look up the connection factory. Since you are accessing the JNDI on system X from outside, you need to set some properties to create the InitialContext:

Properties env = new Properties();

env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");

env.put(Context.PROVIDER_URL, <system X>:<p4 port>); // replace with your settings

env.put(Context.SECURITY_PRINCIPAL, <user name>); // replace with your settings

env.put(Context.SECURITY_CREDENTIALS, <password>); // replace with your settings

naming = new InitialContext(env);

Hope that helps.

Regards,

Sabine

Former Member
0 Kudos

Dear Sabine,

I thank you a lot for this information. I tried your solution principle and my test application worked immediately.

Former Member
0 Kudos

Hi Sabine,

Useful tip

Message was edited by: Achmed Aboulcher