Wednesday 21 August 2013

Top Most WebSphere Application Server Messaging


Messaging is a way to exchange data between different applications. Several applications deployed over WAS can exchange information.  The Service Integration Bus (SIBus, or just the bus) provides a transport mechanism for WebSphere Application Server. The bus serves as the main transport mechanism for messages. Consumers consume messages form some Destination in Bus.  Producer produces and sends messages to some destination in Bus. Bus might be distribued, but applications act if they are interacting with single Bus.  Applications are using Bus to exchange mesages, and thus integrating with each other.  I would like to mention that WAS BUS is different from  WebSphere ESB, which is a separate product. And contains several more features.  WebSphere ESB is built on WebSphere Application Server.  WebSphere ESB also includes additional functions not supplied with WebSphere Application Server.
BUS contains a list of destinations. Incoming messags are routed to destination.  Message Consumers consume messages from Destination.  Most Important, a message can also be routed from one destination to another before being consumed by a receiver.
mediation is a piece of code which is always associated with a destination. Mediation code operates on a message as it traverses that destination.
Following figure would explain the collaboration between producer, consumer, destination and mediation -
Ref. - http://www.ibm.com/developerworks/websphere/techjournal/0501_reinitz/0501_reinitz.html
bus is defined at the cell level. In a standard configuration, no more than one bus is normally required within a cell.
(taken from Red book) In above figure we have one Bus(HR Department Bus) for one cell.  And two Nodes federated. Each Node have on Node Agent. Each node has two application servers. Only one application server is part of the bus. Application Server 2 is Bus Member of HR Department Bus. When a bus member is added, a messaging engine is created in that WebSphere instance, which has its own data store for messages.
For most development activity, you will create and assign a single bus member to the bus.
The Messenging Engine (ME) is a component of WebSphere Application Server.  It communicates messages to destinations, in cooperation with the other MEs of other bus members.  All of the messages that are sent to the destination will be handled by this messaging engine.
(Ref. - ibm.com/developerworks/websphere/library/techarticles/0504_barcia/0504_barcia.html
Multiple application servers can become part one bus.  A messaging engine is associated with a bus member.   When an application server is added as a member of a bus, a messaging engine is automatically created and associated with this application server. Messaging Engines wont be shared among Application Servers.
However, a cell can contain any number of buses. Multiple application servers can become part of different Bus.  If an application server is added as a member of multiple buses, that application server is associated with multiple messaging engines, one messaging engine for each bus of which it is a member. For example, if cell has 4 aplication servers, AS1, AS2, AS3, and AS4. AS1 and AS4 can be member of one bus. AS2 and AS3 can be member of another bus. And As1 can be member of a third bus. And all bus belong to same cell.  Below picture depicts above scenario (picture taken from Red Book) -
message point is the location on a messaging engine where messages are held for a bus destination. A message point can be a queue point, a publication point, or a mediation point (this is a specialized message point) for eg., A queue point is the message point for a queue destination. If the bus member is an application server, a single queue point will be created and associated with the messaging engine on that application server.
When one is browsing the Application Server Console for messages,   s/he has to peek into the message point. for example, in below figure I have created two destinations inside the BUS ( by default there is one more – System.Exception.Destination), and we can see the Queue Depth against the Queue Points -
Messages can also be viewed, by going deep into the Queue Points -
JMS - Java Messaging Service (JMS) is the standard API for accessing enterprise messaging systems from Java-based applications. Java Enterprise Edition (Java EE) applications (producers and consumers) access the SIBus and the bus members through the JMS API.  We can create JMS Connection factory, JMS destinations in WAS console.  Generally we create a Bus, make J2EE(which needs to send or receive messages to BUS) as BUS member.  We also create destinations within the BUS, destinations which would hold messages produced by J2EE applications or which are going to be consumed by J2EE applications.  J2EE applications use JMS API to connect to destinations, send and receive mesages. We need to create JMS Connection Factory and JMS Destination for that. We associate the JMS connection factory and JMS destination to our BUS. JMS destination is associated to SIBUS destination.  Session Enterprise JavaBeans (EJBs)use a JMS connection factory to connect to the JMS provider.  J2EE component Message Driven Beans are EJB’s which listen to any JMS destination, and consume messages. (MDBs) use a JMS activation specification to connect to the JMS provider. The interface between an MDB and its destination is the JMS activation specification.
JMS activation specification is a group of messaging configuration properties, it cannot be manually started and stopped.  It is possible to share a single JMS activation specification with multiple MDBs.  This simplifies administration because it is only necessary to provide a single set of messaging configuration properties.  Activation specifications are simple to configure, because they only require two objects: the activation specification and a message destination.
Below picture depicts how one EJB sends messages to a JMS Destination(associated to a SIBUS destination), and mesages are consumed by a MDB from the same JMS destination (taken from Redbook)-

Some time back I made a video of how to create a JMS Queue in WebSphere Application Server. I uploaded the video under one of my channel, video would really be helpful for a newbie in Web Sphere & JMS -

http://www.youtube.com/watch?v=uCaly04a_lk&feature=plcp&context=C37a70fcUDOEgsToPDskI0v3O4Yifj6K61aKcNwG6n




LinkWithin

Related Posts Plugin for WordPress, Blogger...

Labels

Core Java programming core java interview question Core Java Faq's Servlets coding database jsp-servlet spring Java linux unix interview questions java investment bank Web Services Interview investment bank mysql Senior java developer interviews best practices java collection tutorial RMI SQL Eclipse FIX protocol tutorial tibco J2EE groovy java questions SCJP grails java 5 tutorial jdbc beginner error and exception Design Patterns Java Programming Tutorials fundamentals general object oriented programming xml Java Programs Hibernate Examples Flex JAMon Java xml tutorial logging Jsp Struts 2.0 Sybase and SQL Server debugging java interviews performance FIX Protocol interview questions JUnit testing WebSphere date and time tutorial experienced java IO tutorial java concurrency thread Ejb Freshers Papers IT Management Java Exapmle Java Script SQL and database tutorial examples Scwcd ant tutorials concurrency example and tutorial future state homework java changes java threading tricky Agile Business of IT Development JSTL Java JSON tutorial Java multithreading Tutorials PM Scrum data structure and algorithm java puzzles java tips testing tips windows 8 5 way to create Singleton Object Architect Interview Questions and Answers Architecture Architecure Bluetooth server as swing application that searches bluetooth device in 10 meter circle and show all devices. You can send file to any bluetooth device. C Programming CIO Callable Statement in Java Circular dependency of Objects in Java Comparable Example in Collection Custom annotation in Java Developer Interview Divide and rule example in java Drupal Example of Singleton Pattern FIX protocol ForkJoin Example in Java 7 Get data from dynamic table with Java Script Git HTML and JavaScript Health Hello World TCP Client Server Networking Program Hibernate Basics Hibernate Interview Question Answer J2EE Interview Question And Answers J2ME GUI Program JEE Interview QA JMS interview question Java J2EE Hibernate Spring Struts Interview Question Java System Property Java Threads Manager Portlets Provident Fund Read data from any file in same location and give the required result. Reading Properties File in Java Redpoint Rest WebService Client Rest Webservice Test SAL join with ven diagram SCP UNIX COMMAND SSL Singleton Pattern in Java Spring Bean Initialization methods and their order Spring Interview Questions Struts Struts 2.0 Basics Struts 2.0 Design Pattern Submit Html Form With Java Script On The Fly Unix executable For Java Program XOM DOM SAX XP books computers core java; core java; object oriented programming data structure; java investment bank; design pattern dtd duplicate rows in table get browser name with jquery grails podcast inner class java beginners tutorial java cache java networking tutorial java spring java util; java collections; java questions java.java1.5 linked list mailto function with all browser oracle database oracle duplicate rows orm schema social spring mvc questions struts transaction tricks tweet windows xslt