I am trying to consume messages from WebSphere SIB (default message provider). I did not find many articles related to this topic on the internet. I have tried configuration as described here but i get the below exception:
com.ibm.websphere.ms.Wnsinitalcontextfacotry is not of type javax.jms.ConnectionFactory
Has anybody integrated JMS with WebShphere Default message provider? If yes, can you please provide sample code?
I would like to know how to configure connection factory and topic.
CURRENT Status is Below:
I was able to configure JMS connection factory and topic but hit below exception
The security exception CAUGHT_EXCEPTION_WHILE_CONFIGURING_SSL_CLIENT_SOCKET: JSSL0130E: java.io.IOException: signals that an I/O exception of some sort has occurred.
Check this post. It provides steps and piece of plain Java code, how to access WebSphere Default messaging. You should be able to configure your Spring app based on that.
Related
I am new to JMS and I need to build a generic JMS client to create a connection send and receive message by using queues and topics. I have seen many example using activeMQ connection factory, but I need a generic client which can use any connection factory and create a connection. Any leads or sample codes will be useful.
I have just done that recently. Steps I've taken
Read Java JMS tutorials to understand what is JMS.
You can code in Java or use a framework for example - Spring JMS
Read about MQ provider docs. for example activeMQ or IBM MQ.
Currently I have setup two queues on WebSphere 7. One for sending and one for recieving messages.
I have configured a activation spec on the receiving queue and the messages are consumed fine by a Message Bean.
Also I have written a client that can run on a separate jvm which can send messages fine to the queue.
I am sure that the queues work.
Now I want to know how can I connect them with WebMetods. I know that WebMethods supports JBoss and WebLogic but no support for WebSphere.
I should be able to get this working just by providing:
a provider url - "iiop://172.17.13.65:2809"
a connection factory - "jms/ConnectionFactroy"
a queue name- "jms/inQueue"
and an initial context - "com.ibm.websphere.naming.WsnInitialContextFactory"
(at least this is what my client is using)
Is there anybody that has resolved this issue? And what are the steps they took?
Thank you in advance for your help.
We were able to get this implementation happen.
To solve this Web Methods had to import some jar files for Client JMS:
com.ibm.ws.ejb.thinclient_7.0.0 + com.ibm.ws.orb_7.0.0 + com.ibm.ws.sib.client.thin.jms_7.0.0
And use a bootstrap of this type PROVIDER_URL: "iiop://natasha:2810"
Alaso these details as previously mentioned:
a factory - "jms/ConnectionFactroy"
a queue name- "jms/inQueue" and
an initial context - "com.ibm.websphere.naming.WsnInitialContextFactory"
Reg: JMeter Point-to-Point
Could you please tell how to get the QueueConnnectionFaction
And ContextConnectionFactory
Can anyone help me in configuring JNDI properties in JMS POINT-TO-POINT of JMETER
ERROR - jmeter.protocol.jms.sampler.JMSSampler: progress/message/jclient/TopicConnectionFactory java.lang.NoClassDefFoundError: progress/message/jclient/TopicConnectionFactory
Please provide some solution.
It seems you didn't put a dependency jar from your jms provider, see:
java.lang.NoClassDefFoundError: progress/message/jclient/TopicConnectionFactory
The QueueConnnectionFactory is the container of the queues that is created before the queues. I used to use the Hermes JMS application to get this information but you could get it from WebLogic too.
For example, the next image shows my configuration, using the information of binding for the QueueConnectionFactory field, and using the information of initialContextFactory for the InitialContextFactory field, and do not forget to use the providerURL in the ProviderURL field.
In this example I am not getting the response. For this reason, I am only putting the name of my requester queue.
Ensure that the information is correct. In the JMS Properties you could use Headers for the request.
I wrote a java client to connect to jms in websphere.
I was able to connect and produce and consume message.
Problem I am facing is when I do Session.createQueue(), websphere jms is not creating a new queue.
Please could some one throw some light on this issue...
Thanks in advance...
If you are working with WebSphere MQ as the messaging provider within WebSphere Application Server the queue will need to be created on the WebSphere MQ QueueManager first. This can be done either via the graphical WMQ Explorer or via the command line using the 'runmqsc' tool.
Information can be found for these via the WMQ InfoCentre - suggest doing a websearch for "WMQ Library" to get the latest link, currently though it is http://www-01.ibm.com/software/integration/wmq/library/index.html
Topics though don't need to be pre-created - though they can be if required. Various properties can be set different to the default.
If the Queue doesn't need to be permanent, for example as a temporary reply to then look into creating a temporary queue from the JMS Connection.
createQueue doesn't create a new queue. It simply creates a javax.jms.Queue object from a vendor specific identifier. javax.jms.Queue objects are just references to existing queues. Typically, you retrieve javax.jms.Queue objects from JNDI; createQueue is only useful in scenarios where using JNDI is not possible or not desirable.
Note: there is one exception to this, namely JMS providers that support autocreation of queues (I think ActiveMQ has such a feature).
Hi I am having trouble using the createQueue in JMS. I can create a queue successfully but right after I try to do the following and it fails. Any ideas? Thanks.
QueueSender mySender = mySession.createSender(myQueue);
With the error:
javax.jms.InvalidDestinationException: CWSIA0062E: Failed to create a MessageProducer for queue://Q2?busName=myBus2
at com.ibm.ws.sib.api.jms.impl.JmsMsgProducerImpl.<init>(JmsMsgProducerImpl.java:396)
at com.ibm.ws.sib.api.jms.impl.JmsQueueSenderImpl.<init>(JmsQueueSenderImpl.java:60)
at com.ibm.ws.sib.api.jms.impl.JmsQueueSessionImpl.instantiateProducer(JmsQueueSessionImpl.java:224)
at com.ibm.ws.sib.api.jms.impl.JmsSessionImpl.createProducer(JmsSessionImpl.java:865)
at com.ibm.ws.sib.api.jms.impl.JmsQueueSessionImpl.createSender(JmsQueueSessionImpl.java:147)
The JMS exception is a multi-level data structure where the lower level is for the JMS transport provider to put vendor-specific errors and the top level is for errors in the JMS API. It is very difficult to tell from the stack trace provided which category this falls into. Note that this is not a WebSphere MQ thing, but rather a JMS thing. As a best practice, always print JMS linked exceptions!
There's a code snippet showing this here:
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzaw.doc/uj24500_.htm
Incidentally, although this is tagged as WebSphere MQ, the stack trace indicates that it is WebSphere App Server's SI Bus classes that are being used as the JMS transport. However, the advice applies to JMS with any transport provider and I'd still recommend printing the linked exception to see what's really going on here.