EMS Server Tibco

Source: Internet
Author: User

Http://www.cnblogs.com/jackson-ou/archive/2008/12/30/1365382.html

Note:from Tibco EMS Server Document

1. Message Model
Point-to-Point mode (queue): Each message has only one producer and one consumer. Each queue can have multiple producers and multiple consumers. A queue can be declared to have exclusive sex. Messages with exclusive queue can only be obtained by the first consumer. The message is removed from the queue by a consumer, regardless of whether or not it has exclusive access.

Publish and Subscribe mode (topic): Each message can have several producers and several consumers. Consumers get messages in topic based on subscription relationships. The EMS API allows persistent subscribers, and messages are saved for these persistent subscribers.

2. Destination
The main features of the message model feature include:
A. Provides queue, topic level access control via secure mode, referencing secure mode and destination controls
B. Set up the queue, topic the constraints that occupy the memory space, reference FlowControl and Overflowpolicy
C. Routing messages to destination, reference working with Routes
D. Build a hybrid message model by creating bridge between Destinatin
E. Control the speed at which messages are sent to destination, reference flow controls
G. Exchange messages with other message service, such as queue can rendezvous from Tibco, smartsockets receive messages, topic can exchange messages with Tibco Rendezvous, SmartSockets two-way
H. Queue can be set to have exclusive or non-exclusive, reference exclusive
I. Queue can be set redelivery policy, reference maxredelivery
J. Tracking, log messages to the destination transmission process, reference trace
K. Include user name in the message, reference sender name and sender name enforced
L. Support for wildcards on destination name
M. Set the Failsafe property on topic, queue to save messages to the hard drive
N. Set the consumer to bulk accept messages in the background to provide performance, or set queue messages to receive only one message at a time, refer to Prefetch

3. Client API
Provides an API based on Java,. Net,cobol. The sample code is located in the Samples subdirectory of the installation directory. EMS also provides Java classes for pure Java TIBCO Rendezvous application to connect to EMS Server.

4. Administration
EMS provides a management mechanism for server Operation, server Object (such as connectionfactories, destinations). These management functions can be implemented through administration tool command-line tools, or through the management APIs. The EMS client can obtain a reference to server object through Jndi.

Manage Server features: Using configuration Files, EMS administration Tool, authentication and Permissions, Monitor server activity ( A log file that contains server activity information, which is available for server monitoring in Systemevent message to topic, and for statistical analysis of different levels of detail.

EMS provides localized management of user, groups, and can also be unified through external LDAP. TIBCO Hawk provides management and monitoring of EMS server. EMS Server supports the SSL protocol for Client-server,

Secure communication between the Server-server. Support Backup EMS Server, the implementation of fault tolerance. EMS provides message routing between server-server. Topic messages can be passed between any number of hops, and queue messages are passed at most between hops. The EMS supports storage and forwarding of messages.

=======

There are roughly two types of integration schemes for WebLogic and MQ:
One is to configure MQ as WebLogic external JMS server (foreign JMS servers), and the second is the WebLogic message Bridge (messaging bridges)
Http://www.360doc.com/content/10/1129/16/4810544_73459234.shtml3.3. Integrated into WebLogic
In fact, this part of the work, not much difficulty, is the configuration is more cumbersome, start it:

3.3.1. Creating external JMS Servers (foreign JMS server)

Start WebLogic, Login to console, expand domain-> Service-> Message delivery->JMS module.
Select a new JMS module JMSMODULE_MQ:


Figure 3.3.1: Creating a JMS Module

Select a server:

Figure 3.3.2: Creating a JMS Module 2

In the module just created a resource, the type is external server (foreign server) named FOREIGNSERVER_JMS:

Figure 3.3.3: Creating a Module resource--External server


Figure 3.3.4: Creating a Module resource--External server 2

External Server Jnd Configuration

Figure 3.3.5:jndi Parameters

Create two destinations on external servers:

Figure 3.3.6: Two goals

and two connected factories:

Figure 3.3.7: Two connection factories

After the configuration, of course, to write an MDB test:
The message-driven bean code is as follows:
Java codePackageMqImportJavax.annotation.Resource;ImportJavax.ejb.ActivationConfigProperty;ImportJavax.ejb.MessageDriven;ImportJavax.jms.Message;ImportJavax.jms.MessageListener;ImportJavax.jms.QueueConnection;ImportJavax.jms.QueueSender;ImportJavax.jms.QueueSession;ImportJavax.jms.Session;ImportJavax.jms.TextMessage; /** * * @author Justin/@MessageDriven (name = "TestMDB2", Mappedname = "Jms/applicationjmsqueue", Activat Ionconfig = {@ActivationConfigProperty (propertyname = "destinationtype", PropertyValue = "Javax.jms.Queue")}) PublicclassMQTestBean2ImplementsMessageListener {@Resource (mappedname = "Jms/approvaljmsqueue")PrivateJavax.jms.Queue Approvaljmsqueue; @Resource (mappedname = "Jms/approvalfactory")PrivateJavax.jms.QueueConnectionFactory approvalfactory; PublicvoidOnMessage (Message message) {Try{String msg = ((textmessage) message). GetText ();                System.out.println ("=> received application:" + msg);            SendMessage ("agreed to apply:" + msg); }Catch(Exception ex)            {Ex.printstacktrace (); }        }PrivatevoidSendMessage (String msg)throwsException {Queueconnection conn =NULL; Queuesession session =NULL;Try{conn = approvalfactory.createqueueconnection (); Session = Conn.createqueuesession (false, Session.auto_acknowledge);                Queuesender sender = Session.createsender (approvaljmsqueue);                Message newmsg = Session.createtextmessage (msg);                Sender.send (NEWMSG);            System.out.println ("=> Send approval Result:" + msg); }Catch(Exception e)            {E.printstacktrace (); }finally{Try{Session.close ();                Conn.close (); }Catch(Exception e)                {E.printstacktrace (); }            }        }    }

Package MQ; Import Javax.annotation.Resource; Import Javax.ejb.ActivationConfigProperty; Import Javax.ejb.MessageDriven; Import Javax.jms.Message; Import Javax.jms.MessageListener; Import javax.jms.QueueConnection; Import Javax.jms.QueueSender; Import javax.jms.QueueSession;                                                                                                                                                                                                                          Import javax.jms.Session;                                                                                                                          


The deployment files are as follows:
XML code <?xmlVersion= "1.0" encoding= "UTF-8" ?> <weblogic-ejb-jarXmlns= "Http://www.bea.com/ns/weblogic/90" > <weblogic-enterprise-bean> <ejb-name>TestMDB2 </ejb-name> <message-driven-descriptor> <destination-jndi-name>Jms/applicationjmsqueue </destination-jndi-name> <connection-factory-jndi-name>Jms/applicationfactory </connection-factory-jndi-name> </message-driven-descriptor> </weblogic-enterprise-bean> </weblogic-ejb-jar>
<?xml version= "1.0" encoding= "UTF-8"?> <weblogic-ejb-jar xmlns= "http://www.bea.com/ns/weblogic/90" > <weblogic-enterprise-bean> <ejb-name>TestMDB2</ejb-name> <message-driven-descriptor> < destination-jndi-name> Jms/applicationjmsqueue </destination-jndi-name> <connection-factory-jndi-name > Jms/applicationfactory </connection-factory-jndi-name> </message-driven-descriptor> </ Weblogic-enterprise-bean> </weblogic-ejb-jar>


Package and publish to WebLogic.

Now test:
In MQ Manager, put a message in the application queue:

Figure 3.3.8. Put in the test message

If all configurations are correct, MDB-&GT;MQTESTBEAN2 receives the message just put in and processes it, and then puts it in the approval queue:



Figure 3.3.9.weblogic Server output (NetBeans console)

We can then go to the MQ Manager to view the approval queue and see the message after the MDB is processed:



Figure 3.3.10. To the Approval queue view processed messages

OK, so far, we've managed to seamlessly integrate MQ into the WebLogic so that the MDB deployed on WebLogic can manipulate the MQ queues like native JMS.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.