@ Messagedriven (activationconfig = {@ activationconfigproperty (propertyname ="Destinationtype", Propertyvalue ="Javax. JMS. Queue"),
@ Activationconfigproperty (propertyname ="Destination", Propertyvalue ="Queue/myqueue")
}
)
1. Topics --- you can have multiple clients. Publishing a topic allows one-to-many and multiple-to-many. The value of destinationtype is javax. JMS. Topic.
2. Queue --- only one message can be sent to a customer. The value of destinationtype is javax. JMS. queue.
3. The destination attribute is used to specify the message path. When MDB is released, if the path does not exist, the container will automatically create the path. when the container is closed, the path will be automatically deleted.
// Create a queueconnection
Queueconnection connection = factory. createqueueconnection ();
There are two types of connection: topicconnection and queueconnection.
// Create a queuesession objectQueuesession session = connection. createqueuesession (False, Queuesession. auto_acknowledge );
There are two types of sessions: queuesession and topicsession.
False indicates creating a session that does not require transactions.
In a non-transaction session, there are three message transmission methods:
1. session. auto_acknowledge: when the client calls the receive () method to return a message, or when messagelistener successfully processes the message, the session automatically receives the message receipt.
2. session. client_acknowledge: the client receives messages by calling the acknowledge method.
3. session. dups_acknowledge: The session receives messages slowly.