Sprint JMS and ActiveMQ
=======================
Ascronise message services
JMS can be configured in two ways :-
1.publich and subscriber
2.point to point model
http://icodingclub.blogspot.in/2011/07/introduction-of-spring-jms-with.html
JMS --
java messaging services
client -- sender of message
Message hit that is MOM(message oriented middle ware) server it gets to the receiver from the mom server
RMI is a syncronize message
JMS is used to asyncronize message (no direct contact to sender to receiver means sender do not care to know the receiver receive the message or not)
DO -- destnation object
there are two typer os model for JMS
====================================
1.publischer and subscriber
2.point to point
in case of public subscriver the destination object is know as TOPIC
in case of point to point the destinatin object is know as Queue
BOTH the sender and receiver are the client to JMS
There are different type of messages can be send out here
Lets look out the difference between the
Publish subscriber vs point to point
====================================
in case of public subscriber model, we have n number of sender sending messages to destination object (DO)
its some thing brodcasting
where as point to point
=====================
there are 5 types of messages can be send my JMS
1.Text message
2.MAP message
3.String
4.Object
5.Byte message
====================
How this message difference the eMAIL
====================
Where do we should use JMS application
CRM,Inventry system.
====================
JMS a Specification
need a factory object to send message
====================
JNDI to regiser the objects
JMS Specification
=================
did not said about security,factory object.
================
1.Fast context of JNDI ... fetch the JNDI context
2.Lookup for the connection factory, when i m looking for connection factory here , depending on here which modle i have been using here, either topic connection factory or Quck connection factory.
3.Using the factory object create the connection.
need to open the connection so that we can send the message.
4.Session , create a session object using the connection object, when u create the session object
need to pass two parameeter
by passing
a.transated or not -- boolean value
b.acknolodege type -- three type 1. Auto, 2.Client , 3.Dups OK
Difference between three type ACKs
By defeault Auto acks, once the msg send auto metic come to MOM server
Clien acks is when u have to call
Dups ok acks it says its ok if i recive msg more then once
5.Once get session need to look for the DO (destination object) from the JNDI, thas the topic or Queq
6.Create a sender or publice, or recver or subscrive
7. For the Sender
8.Creater a publiscrer