JBossMQ is composed of several services that work together to provide JMS API-level services to client applications. The services that make up the JBossMQ JMS implementation are introduced in the following sections. The Invocation Layer ServicesThe invocation layer (IL) services are responsible for handling the communication protocols that clients use to send and receive messages. JBossMQ can support running different types of ILs concurrently. All ILs support bidirectional communication, which allows clients to send and receive messages concurrently. ILs only handle the transport details of messaging. They delegate messages to the JMS server JMX gateway service known as the invoker. This is similar to how the detached invokers expose the EJB container via different transports. Each IL service binds a JMS connection factory to a specific location in the JNDI tree. Clients choose the protocol they wish to use by the JNDI location used to obtain the JMS connection factory. JBossMQ currently has several different ILs:
The SecurityManager ServiceThe JBossMQ SecurityManager service enforces an access control list to guard access to your destinations. This subsystem works closely with the StateManager service. The DestinationManager ServiceYou can think of the DestinationManager service as being the central service in JBossMQ. It keeps track of all the destinations that have been created on the server. It also keeps track of the other key services, such as MessageCache, StateManager, and PersistenceManager. The MessageCache ServiceMessages created in the server are passed to the MessageCache service for memory management. JVM memory usage goes up as messages are added to a destination that does not have any receivers. These messages are held in the main memory until the receiver picks them up. If the MessageCache service notices that the JVM memory usage starts passing the defined limits, MessageCache starts moving those messages from memory to persistent storage on disk. The MessageCache uses a least recently used (LRU) algorithm to determine which messages should go to disk. The StateManager ServiceThe StateManager (SM) service is in charge of keeping track of who is allowed to log in to the server and what their durable subscriptions are. The PersistenceManager ServiceA destination uses the PersistenceManager service to store messages marked as being persistent. JBossMQ has several different implementations of the persistence manager (PM), but only one can be enabled per server instance. You should enable the PM that best matches your requirements:
Configurations on the destinations decide whether persistence and caching are actually performed. You can find an example of a configuration in docs/examples/jms. To use the null PM backed by a real PM, you need to change the ObjectName of the real PM and link the new name to the null PM. DestinationsA destination is the object on the JBossMQ server that clients use to send and receive messages. There are two types of destination objects: queues and topics. References to the destinations created by JBossMQ are stored in JNDI. QueuesClients that are in the P2P paradigm typically use queues. They expect that messages sent to a queue will be received by only one other client, only once. If multiple clients are receiving messages from a single queue, the messages will be load balanced across the receivers. Queue objects, by default, are stored under the JNDI queue/ subcontext. TopicsTopics are used in the pub-sub paradigm. When a client publishes a message to a topic, he or she expects that a copy of the message will be delivered to each client that has subscribed to the topic. Topic messages are delivered in a manner similar to how a television show is delivered: Unless you have the TV on and are watching the show, you will miss it. Similarly, if the client is not up, running, and receiving messages from the topics, it will miss messages published to the topic. To get around this problem of missing messages, clients can start a durable subscription. This is like having a VCR or DVR record a show you cannot watch at its scheduled time so that you can see what you missed when you turn your TV back on. |