CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-org-apache-activemq--activemq-all

High performance Apache 2.0 licensed Message Broker supporting JMS, AMQP, MQTT, and HTTP protocols with comprehensive enterprise features including persistence, security, clustering, and Spring integration.

Pending
Overview
Eval results
Files

messages-destinations.mddocs/

Messages and Destinations

ActiveMQ provides comprehensive implementations of all JMS message types with additional scheduling and routing capabilities, plus complete destination support for queues, topics, and temporary destinations.

Capabilities

Base Message Implementation

Core message implementation with ActiveMQ scheduling extensions.

/**
 * Base ActiveMQ message implementation with scheduling support
 * Extends JMS Message with delayed delivery and redelivery features
 */
public class ActiveMQMessage implements Message, ScheduledMessage {
    /** Set message scheduled for future delivery */
    public void setScheduledDeliveryTime(long scheduledDeliveryTime);
    public long getScheduledDeliveryTime();
    
    /** Set delay before initial delivery */
    public void setRedeliveryDelay(long redeliveryDelay);
    public long getRedeliveryDelay();
    
    /** Set periodic delivery schedule */
    public void setPeriod(long period);
    public long getPeriod();
    
    /** Set number of times to repeat delivery */
    public void setRepeat(int repeat);
    public int getRepeat();
    
    /** Set CRON expression for complex scheduling */
    public void setCronEntry(String cronEntry);
    public String getCronEntry();
    
    /** Standard JMS message properties */
    public String getJMSMessageID() throws JMSException;
    public void setJMSMessageID(String id) throws JMSException;
    public long getJMSTimestamp() throws JMSException;
    public void setJMSTimestamp(long timestamp) throws JMSException;
    public byte[] getJMSCorrelationIDAsBytes() throws JMSException;
    public void setJMSCorrelationIDAsBytes(byte[] correlationID) throws JMSException;
    public String getJMSCorrelationID() throws JMSException;
    public void setJMSCorrelationID(String correlationID) throws JMSException;
    public Destination getJMSReplyTo() throws JMSException;
    public void setJMSReplyTo(Destination replyTo) throws JMSException;
    public Destination getJMSDestination() throws JMSException;
    public void setJMSDestination(Destination destination) throws JMSException;
    public int getJMSDeliveryMode() throws JMSException;
    public void setJMSDeliveryMode(int deliveryMode) throws JMSException;
    public boolean getJMSRedelivered() throws JMSException;
    public void setJMSRedelivered(boolean redelivered) throws JMSException;
    public String getJMSType() throws JMSException;
    public void setJMSType(String type) throws JMSException;
    public long getJMSExpiration() throws JMSException;
    public void setJMSExpiration(long expiration) throws JMSException;
    public int getJMSPriority() throws JMSException;
    public void setJMSPriority(int priority) throws JMSException;
    
    /** Message properties */
    public void clearProperties() throws JMSException;
    public boolean propertyExists(String name) throws JMSException;
    public boolean getBooleanProperty(String name) throws JMSException;
    public byte getByteProperty(String name) throws JMSException;
    public short getShortProperty(String name) throws JMSException;
    public int getIntProperty(String name) throws JMSException;
    public long getLongProperty(String name) throws JMSException;
    public float getFloatProperty(String name) throws JMSException;
    public double getDoubleProperty(String name) throws JMSException;
    public String getStringProperty(String name) throws JMSException;
    public Object getObjectProperty(String name) throws JMSException;
    public Enumeration getPropertyNames() throws JMSException;
    public void setBooleanProperty(String name, boolean value) throws JMSException;
    public void setByteProperty(String name, byte value) throws JMSException;
    public void setShortProperty(String name, short value) throws JMSException;
    public void setIntProperty(String name, int value) throws JMSException;
    public void setLongProperty(String name, long value) throws JMSException;
    public void setFloatProperty(String name, float value) throws JMSException;
    public void setDoubleProperty(String name, double value) throws JMSException;
    public void setStringProperty(String name, String value) throws JMSException;
    public void setObjectProperty(String name, Object value) throws JMSException;
    
    /** Message acknowledgment */
    public void acknowledge() throws JMSException;
    
    /** Clear message body */
    public void clearBody() throws JMSException;
}

Usage Examples:

// Schedule message for future delivery
TextMessage message = session.createTextMessage("Delayed message");
message.setScheduledDeliveryTime(System.currentTimeMillis() + 60000); // 1 minute delay

// Periodic message delivery
TextMessage periodicMessage = session.createTextMessage("Periodic update");
periodicMessage.setPeriod(30000); // Every 30 seconds
periodicMessage.setRepeat(10); // Repeat 10 times

// CRON-based scheduling
TextMessage cronMessage = session.createTextMessage("Daily report");
cronMessage.setCronEntry("0 0 9 * * ?"); // Every day at 9 AM

Text Messages

Messages containing string payloads.

/**
 * Text message implementation for string content
 */
public class ActiveMQTextMessage extends ActiveMQMessage implements TextMessage {
    /** Set text content */
    public void setText(String string) throws JMSException;
    
    /** Get text content */
    public String getText() throws JMSException;
}

Bytes Messages

Messages containing binary data with stream-like access.

/**
 * Bytes message implementation for binary content
 */
public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessage {
    /** Get body length in bytes */
    public long getBodyLength() throws JMSException;
    
    /** Read bytes from message body */
    public int readBytes(byte[] value) throws JMSException;
    public int readBytes(byte[] value, int length) throws JMSException;
    
    /** Write bytes to message body */
    public void writeBytes(byte[] value) throws JMSException;
    public void writeBytes(byte[] value, int offset, int length) throws JMSException;
    
    /** Read typed values */
    public boolean readBoolean() throws JMSException;
    public byte readByte() throws JMSException;
    public int readUnsignedByte() throws JMSException;
    public short readShort() throws JMSException;
    public int readUnsignedShort() throws JMSException;
    public char readChar() throws JMSException;
    public int readInt() throws JMSException;
    public long readLong() throws JMSException;
    public float readFloat() throws JMSException;
    public double readDouble() throws JMSException;
    public String readUTF() throws JMSException;
    
    /** Write typed values */
    public void writeBoolean(boolean value) throws JMSException;
    public void writeByte(byte value) throws JMSException;
    public void writeShort(short value) throws JMSException;
    public void writeChar(char value) throws JMSException;
    public void writeInt(int value) throws JMSException;
    public void writeLong(long value) throws JMSException;
    public void writeFloat(float value) throws JMSException;
    public void writeDouble(double value) throws JMSException;
    public void writeUTF(String value) throws JMSException;
    
    /** Reset message for reading */
    public void reset() throws JMSException;
}

Map Messages

Messages containing name-value pairs.

/**
 * Map message implementation for key-value content
 */
public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
    /** Get value by name */
    public boolean getBoolean(String name) throws JMSException;
    public byte getByte(String name) throws JMSException;
    public short getShort(String name) throws JMSException;
    public char getChar(String name) throws JMSException;
    public int getInt(String name) throws JMSException;
    public long getLong(String name) throws JMSException;
    public float getFloat(String name) throws JMSException;
    public double getDouble(String name) throws JMSException;
    public String getString(String name) throws JMSException;
    public byte[] getBytes(String name) throws JMSException;
    public Object getObject(String name) throws JMSException;
    
    /** Set value by name */
    public void setBoolean(String name, boolean value) throws JMSException;
    public void setByte(String name, byte value) throws JMSException;
    public void setShort(String name, short value) throws JMSException;
    public void setChar(String name, char value) throws JMSException;
    public void setInt(String name, int value) throws JMSException;
    public void setLong(String name, long value) throws JMSException;
    public void setFloat(String name, float value) throws JMSException;
    public void setDouble(String name, double value) throws JMSException;
    public void setString(String name, String value) throws JMSException;
    public void setBytes(String name, byte[] value) throws JMSException;
    public void setBytes(String name, byte[] value, int offset, int length) throws JMSException;
    public void setObject(String name, Object value) throws JMSException;
    
    /** Check if item exists */
    public boolean itemExists(String name) throws JMSException;
    
    /** Get all map names */
    public Enumeration getMapNames() throws JMSException;
}

Object Messages

Messages containing serializable Java objects.

/**
 * Object message implementation for serializable Java objects
 */
public class ActiveMQObjectMessage extends ActiveMQMessage implements ObjectMessage, TransientInitializer {
    /** Set object payload */
    public void setObject(Serializable object) throws JMSException;
    
    /** Get object payload */
    public Serializable getObject() throws JMSException;
}

Stream Messages

Messages containing a stream of typed primitive values.

/**
 * Stream message implementation for sequential primitive values
 */
public class ActiveMQStreamMessage extends ActiveMQMessage implements StreamMessage {
    /** Read typed values in sequence */
    public boolean readBoolean() throws JMSException;
    public byte readByte() throws JMSException;
    public short readShort() throws JMSException;
    public char readChar() throws JMSException;
    public int readInt() throws JMSException;
    public long readLong() throws JMSException;
    public float readFloat() throws JMSException;
    public double readDouble() throws JMSException;
    public String readString() throws JMSException;
    public int readBytes(byte[] value) throws JMSException;
    public Object readObject() throws JMSException;
    
    /** Write typed values in sequence */
    public void writeBoolean(boolean value) throws JMSException;
    public void writeByte(byte value) throws JMSException;
    public void writeShort(short value) throws JMSException;
    public void writeChar(char value) throws JMSException;
    public void writeInt(int value) throws JMSException;
    public void writeLong(long value) throws JMSException;
    public void writeFloat(float value) throws JMSException;
    public void writeDouble(double value) throws JMSException;
    public void writeString(String value) throws JMSException;
    public void writeBytes(byte[] value) throws JMSException;
    public void writeBytes(byte[] value, int offset, int length) throws JMSException;
    public void writeObject(Object value) throws JMSException;
    
    /** Reset stream for reading */
    public void reset() throws JMSException;
}

BLOB Messages

Messages for large binary objects stored externally.

/**
 * BLOB message implementation for large binary objects
 * Stores large content externally to avoid memory issues
 */
public class ActiveMQBlobMessage extends ActiveMQMessage implements BlobMessage {
    /** Set BLOB downloader for retrieving content */
    public void setBlobDownloader(BlobDownloader blobDownloader);
    public BlobDownloader getBlobDownloader();
    
    /** Get input stream for reading BLOB content */
    public InputStream getInputStream() throws IOException, JMSException;
    
    /** Get BLOB URL */
    public URL getURL() throws JMSException;
    
    /** Set BLOB URL */
    public void setURL(URL url);
    
    /** Get BLOB name */
    public String getName() throws JMSException;
    
    /** Set BLOB name */
    public void setName(String name) throws JMSException;
    
    /** Check if BLOB is deleted on delivery */
    public boolean isDeletedByBroker();
    public void setDeletedByBroker(boolean deletedByBroker);
}

/**
 * Interface for BLOB message support
 */
public interface BlobMessage extends Message {
    public InputStream getInputStream() throws IOException, JMSException;
    public URL getURL() throws JMSException;
    public String getName() throws JMSException;
    public void setName(String name) throws JMSException;
}

Destinations

Destination implementations for message routing.

/**
 * Base destination implementation
 */
public abstract class ActiveMQDestination implements Destination, Serializable, Comparable<ActiveMQDestination> {
    /** Get destination's physical name */
    public String getPhysicalName();
    
    /** Set destination's physical name */
    public void setPhysicalName(String physicalName);
    
    /** Check destination type */
    public boolean isQueue();
    public boolean isTopic();
    public boolean isTemporary();
    
    /** Create destination from string */
    public static ActiveMQDestination createDestination(String name, byte defaultType);
    public static ActiveMQDestination[] createDestinations(String names, byte defaultType);
    
    /** Destination options */
    public void setOptions(Map<String, String> options);
    public Map<String, String> getOptions();
}

/**
 * Queue destination for point-to-point messaging
 */
public class ActiveMQQueue extends ActiveMQDestination implements Queue {
    /** Create queue with name */
    public ActiveMQQueue(String name);
    
    /** Get queue name */
    public String getQueueName() throws JMSException;
    
    /** Create queue from URI */
    public static ActiveMQQueue createQueue(String name);
}

/**
 * Topic destination for publish-subscribe messaging
 */
public class ActiveMQTopic extends ActiveMQDestination implements Topic {
    /** Create topic with name */
    public ActiveMQTopic(String name);
    
    /** Get topic name */
    public String getTopicName() throws JMSException;
    
    /** Create topic from URI */
    public static ActiveMQTopic createTopic(String name);
}

/**
 * Temporary queue destination
 */
public class ActiveMQTempQueue extends ActiveMQTempDestination implements TemporaryQueue {
    /** Get queue name */
    public String getQueueName() throws JMSException;
    
    /** Delete temporary queue */
    public void delete() throws JMSException;
}

/**
 * Temporary topic destination
 */
public class ActiveMQTempTopic extends ActiveMQTempDestination implements TemporaryTopic {
    /** Get topic name */
    public String getTopicName() throws JMSException;
    
    /** Delete temporary topic */
    public void delete() throws JMSException;
}

/**
 * Base class for temporary destinations
 */
public abstract class ActiveMQTempDestination extends ActiveMQDestination {
    /** Delete temporary destination */
    public abstract void delete() throws JMSException;
    
    /** Get connection ID */
    public String getConnectionId();
    
    /** Set connection ID */
    public void setConnectionId(String connectionId);
}

Usage Examples:

// Creating destinations
ActiveMQQueue queue = new ActiveMQQueue("orders.processing");
ActiveMQTopic topic = new ActiveMQTopic("news.updates");

// Queue with options
ActiveMQQueue priorityQueue = new ActiveMQQueue("high.priority?prioritizedMessages=true");

// Topic with selector
ActiveMQTopic filteredTopic = new ActiveMQTopic("events.filtered?retroactive=true");

// Temporary destinations
TemporaryQueue tempQueue = session.createTemporaryQueue();
TemporaryTopic tempTopic = session.createTemporaryTopic();

// Clean up temporary destinations
tempQueue.delete();
tempTopic.delete();

Composite Destinations

Special destinations for advanced routing scenarios.

/**
 * Composite destination for sending to multiple destinations
 */
public class ActiveMQCompositeDestination extends ActiveMQDestination {
    /** Create composite destination from destination array */
    public ActiveMQCompositeDestination(ActiveMQDestination[] destinations);
    
    /** Get constituent destinations */
    public ActiveMQDestination[] getDestinations();
    
    /** Set constituent destinations */
    public void setDestinations(ActiveMQDestination[] destinations);
}

Usage Examples:

// Send message to multiple destinations
ActiveMQQueue queue1 = new ActiveMQQueue("orders.processing");
ActiveMQQueue queue2 = new ActiveMQQueue("orders.audit");
ActiveMQCompositeDestination composite = new ActiveMQCompositeDestination(
    new ActiveMQDestination[]{queue1, queue2}
);

MessageProducer producer = session.createProducer(composite);
producer.send(session.createTextMessage("Order processed"));

Types

/**
 * Interface for scheduled message delivery
 */
public interface ScheduledMessage {
    /** Constants for scheduling properties */
    String AMQ_SCHEDULED_DELAY = "AMQ_SCHEDULED_DELAY";
    String AMQ_SCHEDULED_PERIOD = "AMQ_SCHEDULED_PERIOD";
    String AMQ_SCHEDULED_REPEAT = "AMQ_SCHEDULED_REPEAT";
    String AMQ_SCHEDULED_CRON = "AMQ_SCHEDULED_CRON";
    
    /** Set scheduled delivery time */
    void setScheduledDeliveryTime(long scheduledDeliveryTime);
    long getScheduledDeliveryTime();
}

/**
 * BLOB download strategy interface
 */
public interface BlobDownloadStrategy {
    /** Download BLOB content */
    InputStream getInputStream(ActiveMQBlobMessage message) throws IOException, JMSException;
    
    /** Delete BLOB after download */
    void deleteFile(ActiveMQBlobMessage message) throws IOException, JMSException;
}

/**
 * BLOB upload strategy interface
 */
public interface BlobUploadStrategy {
    /** Upload BLOB content */
    BlobUploadStrategy uploadFile(ActiveMQBlobMessage message, File file) throws JMSException, IOException;
    
    /** Upload BLOB from input stream */
    BlobUploadStrategy uploadStream(ActiveMQBlobMessage message, InputStream in) throws JMSException, IOException;
}

Install with Tessl CLI

npx tessl i tessl/maven-org-apache-activemq--activemq-all

docs

connection-pooling.md

embedded-broker.md

index.md

jms-client.md

management-monitoring.md

messages-destinations.md

network-clustering.md

persistence-storage.md

security.md

spring-integration.md

transport-protocols.md

tile.json