ArchitectureThe following section walks through the main parts of Apache ActiveMQ and links to the code to help you understand the layout
JMS ClientThe org.apache.activemq TransportThe JMS client and the message broker use the Transport So the TransportChannel is basically concerned with sending and receiving Command WireFormatThere are various possible ways of encoding messages onto a stream. We may wish to adapt to various different encoding mechanisms - such as to provide simpler wire formats for talking to C / JavaScript or to make a C# friendly encoding. So all the Transport implementations take a pluggable WireFormat implementation class - which is a Strategy Pattern for deciding how to write the Command to a DataIn / DataOut stream or Datagram. So if you wish to provide your own binary, on the wire protocol then we just need a WireFormat implementation of your protocol, then we can use this with any transport (TCP BIO, NIO, JXTA etc). We use OpenWireFormat Default Wire FormatThe default wire format writes a byte which indicates the kind of Command which is being sent (see the Command The core JMS Message types each have a unique byte ID for
Then in addition there are various other types of command
There are a few others; the org.apache.activemq.command Basically the DefaultWireFormat has a default encoding of each of these commands. So after the first byte which indicates the type of packet is written, there is a specific wire format per packet type. For new wire formats it may be that you only need to support a small subset of these types. e.g. you might just have a simple publish message, consume message & message ack. Message BrokerThe APIs for the message broker (server side of the JMS client) are defined in the org.apache.activemq.broker To see an overview of these packages try the JavaDocs |
