Setting up MDBs to consume JMS messages in Weblogic 10.3.5 - jms

I'm trying to set up part of an application which uses MDBs to consume messages from a JMS Queue. I've looked through the Oracle documentation but can't seem to make sense of it. Examples on the internet seem to be for situations where your JMS server is the same weblogic server where you are consuming but in my case there is a separate server.
I've found this post Weblogic EJB connection to external Tibco EMS JMS Queue which gives broad strokes but seems to be written more for experienced weblogic users.
Specifically with the linked here is where I'm having trouble:
Create a foreign server with all the normal details (local/remote JNDI lookup names for destination and connection factories).
Not sure how to do this.
Create a local WL user with the same name as the remote EMS user, including password.
I cannot do this as my password is less than 8 characters
Create an ejb credential mapping (NOT security credential mapping)
do this by clicking on the relevant deployment, click on the relevant ejb name in the list, then Security tab then Credentials Mapping tab.
add the same name for WLS and Remote users (password doesn't seem to be necessary here).
Under Security I see Application/Module Scope tabs and Roles/Policies underneath those.
Can anyone give more detailed steps on how to set up a simple MDB in Weblogic 10.3.5 which consumes JMS messages from an external server (Tibco EMS)?
I have an ldap url, a selector (to filter out unwanted messages, not completely necessary), username and password, Queue name, EMS server url (which specifies a port), connection factory ldap. What do I do with this information?

You can configure a foreign server in weblogic and inside the foreign server you can provide the connection factory & destination details. The username, passwd & queue name that you have will be required to create these weblogic admin objects.
Weblogic foreign server configuration
While creating the destination you can provide the local jndi name which you can use in your MDB Activation configuration to connect to.

Related

MDB unable to connect Foreign Server destination in Weblogic 12c Cluster

I have deployed EAR in Weblogic 12c server targeting a cluster. Here cluster comprises of 2 managed servers on same physical machine.
Now, as per my requirement the application consumes messages from foreign destination e.g. MQ Series, so I have an MDB in my application that should make connection to remote queue via JNDI lookup.
So, in order to fulfill this, I have perfomed following steps:
1) Created a JMS server which targets to cluster.
2) Created a JMS Module which targets to cluster.
3) Inside JMS module created a Foreign server and checked on option - "Default Targeting Enabled". So, it is also targetting to cluster same as its parent.
4) Inside Foreign server, I have created destination and connection factories.
After making above changes, when I tried to deploy my EAR, I am getting following error messages. My MDB is not making connection to destination message queue.
The Message-Driven EJB TestMDB is unable to connect to the JMS destination jms/TEST_FEED_QUEUE. The Error was:
The destination for the MessageDrivenBean TESTMDB could not be resolved at this time. Please ensure the destination is available at the JNDI name jms/TEST_FEED_QUEUE. The EJB container will periodically attempt to resolve this MessageDrivenBean destination and additional warnings may be issued.
Similar errors were displayed on other managed server as well.
Please suggest, where I am doing wrong. Please suggest.

How websphere server creates and manages JMS resources internally

When we set up a queue connection factory, a topic connection factory, a queue, a topic in websphere application server throguh the console, what exactly happens?
The server stores the configuration details in an xml and at server startup, it creates the connection factory(ies), topic(s),queue(s) and puts them in a pool?
I ask because the actual queue(s) and topics(s) itself do not reside on the App server, they reside on a separate (remote) websphere MQ server. So why do we need to 'create' the queues in Websphere App server?
The configuration is metadata for connecting to the remote objects. When the server starts (or an app restarts, or configuration is refreshed), the server reads the .xml, then binds Reference objects into JNDI. The actual connection factories aren't created/pooled until the Reference is first looked up.
I don't have enough experience with JMS to answer your second question, but presumably the metadata is required for the queue in order to access it remotely.

Configuring JBoss EPA 6.1 with IBM MQ

I am developing a service for JMS messaging using IBM WMQ version 7.5 as Message oriented middleware. I am in a dilemma. The IBM specification says to use WebSphere MQ JMS API in JAVA EE environment. My sender and receivers will be in remote JBoss deployments. IBM provides a resource adapter to connect via JCA. This connection requires static administration of components such as Queue managers, queue channels, queue names.
Is JCA the best I can do ? Is there any other way where I can dynamically create the queues provided that I know other configuration details ? There will be multiple applications using this setup running on their own servers. If I use JCA, all have to make their own configurations. Can I make dynamic configurations ?
Typically within the application server environment resources would be created in some JNDI context. These would be Connection Factories and Destinations.
Depending on the app server, it may be possible to share this configuration across a network of individual servers. So typically there would be some set of static definitions.
However within say a servlet the MQConnectionFactory can be dynamically created.
In all cases the backing WMQ Resources do need to exist; though it is possible to send administrative command messages to WMQ to create queues and do other admin. The only exception is topics, accessing a topic string brings it into existence. Though this has default security properties that you might not want.

Not able to create jms queues in websphere programatically using standalone java client

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).

What is Foreign JMS provider? What is the typical role of Weblogic in a JMS application?

Currently I am working on a JMS application. But I use plain JMS API and Property file for configurations. My application is running in Weblogic and connects to MQ series server of my client.
Recently I got to know I can use Weblogic for JMS configurations.
Please explain.
What is "Foreign JMS provider"?
Is Weblogic also a JMS server or Foreign JMS provider or Both?
Weblogic provides the JMS Server features fully compliant with all JMS spec elements such as ConnectionFactory and Destinations. On this JMS Server you can connect and send messages to the client's Messaging Server via a configured Destination.
In addition using Weblogic as the JMS Server gives you lot many features such as Message Retry in case of failure, setting message quotas as well as enhanced monitoring of the JMS Server to track errors. The idea is to have more configuration driven settings for performance, deadlocks, tuning, filestore or database store etc.
A full list of such features is given at http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jms/fund.html#wp1071787
A Foreign JMS Provider in Weblogic is the term used to define JMS implementations other than Weblogic JMS. An example is IBM MQ in your case.
Once the Foreign Provider is configured within Weblogic, for all practical purposes within the code - it can be called as if it was on local JNDI lookup. Weblogic will make the remote calls transparent to your code. This allows you to change your destination via configuration on the Weblogic console.
You will need a Messaging Bridge within Weblogic JMS Server to connect a source destination from which messages are received, and a target destination to which messages are sent.
Some essential reading on this is at: http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jms_admin/advance_config.html#wp1075917
and an example of configuring IBM MQ as a Foreign Provider is at http://www.ibm.com/developerworks/websphere/library/techarticles/0604_kesavan/0604_kesavan.html#N1011D

Resources