JMS Section Index | Page 7
Should the producing client store data in a message's header or its body?
Decisions regarding where to store data should be based on the following guidelines:
The primary purpose of the header is to identify and route messages.
JMS does not provide a consuming client w...more
How does a consumer acknowledge a message from a producer?
The easiest way is to allow the framework to do it--automatic acknowledgment:
...
topicCon.createTopicSession(false, AUTO_ACKNOWLEDGE);
...
With client acknowledgment, a client can allow m...more
Is it possible for a consumer to look ahead at incoming messages? Is there anything for messages similar to the C library's getc() and ungetc() for character streams?
With point-to-point messaging, QueueBrowser supports look-ahead or primitive browsing operations without removing the message from the queue. QueueBrowser makes messages in the queue available vi...more
Is it possible to do RMI-like, request-reply communication with JMS?
No and yes. JMS provides no analog to structured, remote method invocation, that is, with strong data typing of arguments packaged succinctly in a single method call, and with a type-checked retu...more
Is it possible to turn off message acknowledgment if it is not important for a particular communication scenario?
Sort of. In this situation, in general, you can improve throughput by setting the acknowledgment mode to permit duplicates, that is, by allowing the JMS server to avoid the overhead of the once-a...more
Which JMS vendors fully support JNDI look-up operations for connection factories and destinations?
At this time, the following vendors/products provide some form of direct support for JNDI look-up operations via their JMS server:
SoftWired's iBus//MessageServer - Over-the-network access to con...more
Why is JNDI important anyway?
JMS clients must set up the proper network-capable objects, for example, connection factories, in order to obtain access to other server-resident objects, for example, connections and topics. The...more
Does JMS directly support XML?
No. The JMS specification defines five message types:
StreamMessage - a stream of Java primitive values
MapMessage - a set of name-value pairs
TextMessage - a String object
ObjectMessage - a ser...more
How does a client accommodate asynchronous message notifications from the JMS server?
To receive messages asynchronously, a client must:
Implement javax.jms.MessageListener:
public interface MessageListener {
void onMessage(Message message);
}
Register the message handler usin...more
How do you implement a client that publishes to a topic?
Client implementations vary with respect to set-up operations, depending on the JMS implementation. The following client, TimePublisherSonicMQ, works with the SonicMQ JMS server:
import java.uti...more
How do you implement a client that receives messages via a queue?
Client implementations vary with respect to set-up operations, depending on the JMS implementation. The following client, ObjectReceiver, works with the WebLogic Java application server, which su...more
How do you implement a client that sends messages via a queue?
Client implementations vary with respect to set-up operations, depending on the JMS implementation. The following client, ObjectSender, works with the WebLogic Java application server, which supp...more
How do you implement a client that subscribes to a topic?
Client implementations vary with respect to set-up operations, depending on the JMS implementation. The following client, TimeSubscriberSonicMQ, works with the SonicMQ JMS server:
import javax.j...more
How does a client create a topic (or a queue)?
In the section "Topic Management" the JMS specification states: "JMS does not define facilities for creating, administering, or deleting topics." In the JMS API, however, the QueueSession and To...more
Can a client produce a message to multiple destinations, that is, to a list?
No. A client, in a single operation, cannot publish to a list of topics and it cannot send to multiple queues. A client must establish a message-producer object for each topic/queue and manually...more