Home / OIM / Bind TIBCO Queue and Message Driven Bean configuration to read the queue.

Bind TIBCO Queue and Message Driven Bean configuration to read the queue.

1.
Get below details from TIBCO EMS system.
Example values are shown for understanding only.

      JMS Server Name
: tibjmsnaming://host:port
      Queue Name :  JMS.TEST.
      Connection Factory :-
QueueConnectionFactory                                      
      UserName: userId
      Password : password

2.
Configure JMS Module and Foreign Server

When we have to integrate the TIBCO queue with
application deployed in weblogic server then we have to configure foreign
server in JMS module.  Below are the
steps
1.    Copy tibjms.jar & jms-2.0.jar
in WebLogic domain lib folder and add in class path if required. By default
WebLogic picks new jar from domain lib folder after restart.
2.    Login to weblogic console.
3.    Navigate to JMS Modules.
Click on Lock & Edit.
4.    Click on New JMS Module.
5.    Enter Name as “TestJMSModule”.
Click on Next.
6.    Select Oracle Identity Manager (OIM) Cluster checkbox. Click
on Next and then Finish.
7.    Open the newly created JMS Module
“TestJMSModule”.
8.    Click on New and select Foreign
Server radio button. Click next.
9.    Provide the Foreign server name as
“TestJMSFServer”. Click on next.
10.  Select Oracle Identity Manager (OIM) Cluster checkbox. Click
on Finish
11.  Click on newly created foreign
server.
12.  Provide the following details.
Attribute Name

 

Attribute Value

 

 

JNDI Initial
Context Factory

 

 

com.tibco.tibjms.naming.TibjmsInitialContextFactory

 

 

JNDI
Connection URL

 

 

//TIBCO
Connection url. For e.g tibjmsnaming://test01x:7222

 

 

JNDI
Properties Credential

 

 

//User’s password
mentioned in JNDI properties

 

 

Confirm JNDI
Properties Credential

 

 

//User’s
password mentioned in JNDI properties

 

 

JNDI
Properties

 

 

//Name of the
user used to connect TIBCO Queue.

 

java.naming.security.principal=Oracle Identity Manager (OIM)AppUser
13.  Click on Save.
14.  Click on Destinations tab and
click on New.
15.  Provide the following details.

 

Attribute Name

 

Attribute Value

 

 

Name

 

 

TestDestination

 

 

Local JNDI
Name

 

 

jms.TibcoTestQ

 

 

Remote JNDI
Name

 

 

//Provide the
JNDI name given in TIBCO server. For.e.g JMS.TEST.Q
16.  Click on Save.
17.  Click on Connection Factories tab
and click on New.
18.  Provide the following details.
Attribute Name

 

Attribute Value

 

 

Name

 

 

TestConnectionFactory

 

 

Local JNDI
Name

 

 

jms.TibcoTestConnectionFactory

 

 

Remote JNDI
Name

 

 

//Provide the
connection factory name given in TIBCO server. For.e.g QueueConnectionFactory
19.  Click on OK.
20.  Click on the newly created
Connection factory.
21.  Provide the following details.
Attribute Name

 

Attribute Value

 

 

User Name

 

 

//Name of the
user used to connect TIBCO Queue.

 

For.e.g Oracle Identity Manager (OIM)AppUser

 

Password

 

 

//Password of
the User.

 

 

Confirm
Password

 

 

//Password of
the User.
22.  Click on Save.
23.  Click on Activate changes.
   Note – You
can keep local JNDI same as remote or different. Use the local name in WebLogic
ear xml.

3.
Message Driven Bean class and ear

Once the message is posted on TIBCO queue, you can
read that message by writing standalone class or you can deploy message driven
bean on weblogic server. This will read the message nearly real time.
Below are the steps to create MDB ear.
1.    Write a class which will implement
MessageDrivenBean, MessageListener interfaces.
For.e.g :
public class MessageDrivenBean implements
MessageDrivenBean, MessageListener {
    /**
     */
public MessageDrivenBean() {

super();
    }
    /**
*  @purpose This method reads the
incoming messages and sends that message to execute method to process the data.
     *  @param message
     */
public void onMessage(Message message) {

String METHOD_NAME = “/onMessage()”;

LOGGER.entering(this.getClass().getSimpleName(), METHOD_NAME);

try {

if (message instanceof TextMessage) {
                LOGGER.fine(“Queue: I
received a TextMessage at ” + new Date());
                TextMessage msg =
(TextMessage)message;
                LOGGER.fine(“Message is :
” + msg.getText());

} else if (message instanceof ObjectMessage) {
                LOGGER.fine(“Queue: I
received an ObjectMessage ” + ” at ” + new Date());

        ObjectMessage msg =
(ObjectMessage)message;
} else {
LOGGER.fine(“Not valid
message for this Queue MDB”);

}

} catch (JMSException ex) {
            LOGGER.log(LOGGER.getLevel().SEVERE,

this.getClass().getSimpleName() + METHOD_NAME + ” Generic exception
occured” + ex.getMessage() + “n”);
}
LOGGER.exiting(this.getClass().getSimpleName(), METHOD_NAME)
    }
}
2.     Prepare ejb-jar.xml and weblogic-ejb-jar.xml file.
2.1  Sample ejb-jar.xml

 

 “-//Sun Microsystems, Inc.//DTD
Enterprise JavaBeans 2.0//EN”
 “http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd”>
MDB_Name

MessageDrivenBean     

Container     

javax.jms.Queue

 

 

               MDB_Name
NotSupported
2.2  Sample weblogic-ejb-jar.xml
MDB_Name
10

2
      jms.TibcoTestQ
jms.TibcoTestConnectionFactory

True
Note: Destination and connection factory jndi names
are local jndi name specified in foreign server configuration.
3.
Create the jar file with below
structure.
4.
Prepare application.xml file.
Sample below.

 

TESTEJB.jar

 

Note: ejb name is the name of the jar created in step
3.
5.
Create the ear file with below
structure.
TESTEJB
    |______ APP-INF
    |                 |______lib (inside this folder
keep the required external jars which are                    
    |                                      required
for your project)           
    |
    |______ META-INF
    |                  |______ application.xml
    |
    |______ TESTEJB.jar

4.
Deploy Message Driven Bean ear

1.
Login to weblogic console.
2.
Click on Lock & Edit.
3.
Click on Deployment. Click on
install.
4.
Click on “upload your files”.
5.
Click the browse button besides
“deployment achieve”.
6.
Browse till the location where TESTEJB.ear file is
placed on local machine.
7.
Click next.
8.
After seeing successful upload message,
click next.
9.
Select “Install this deployment
as an application” click next.
10.  Select the Oracle Identity Manager (OIM) Cluster check box.
11.  Click next.
12.  Click next.
13.  Click on finish. Click on Save.
14.  If application in prepared state then make it active by selecting
application and then “Servicing all request” from Start drop down and click on
save.
15.  Click on Activate changes.

Check Also

Logging into & setting up iManager

Logging into iManager is a little deceptive if trying to do it for the first …

Taking Control of Your Oracle Identity Manager Scheduler

According to Oracle’s sizing guide for Oracle Identity Manager (OIM) 10g in a large deployment …