Search in sources :

Example 11 with ActiveMQMessageProducer

use of org.apache.activemq.ActiveMQMessageProducer in project activemq-artemis by apache.

the class CompressedInteropTest method sendCompressedTextMessageUsingOpenWire.

private void sendCompressedTextMessageUsingOpenWire() throws Exception {
    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    ActiveMQDestination destination = createDestination(session, ActiveMQDestination.QUEUE_TYPE);
    final ActiveMQMessageProducer producer = (ActiveMQMessageProducer) session.createProducer(destination);
    TextMessage textMessage = session.createTextMessage(TEXT);
    producer.send(textMessage);
}
Also used : ActiveMQMessageProducer(org.apache.activemq.ActiveMQMessageProducer) TextMessage(javax.jms.TextMessage) Session(javax.jms.Session) ActiveMQDestination(org.apache.activemq.command.ActiveMQDestination)

Example 12 with ActiveMQMessageProducer

use of org.apache.activemq.ActiveMQMessageProducer in project activemq-artemis by apache.

the class CompressedInteropTest method sendCompressedObjectMessageUsingOpenWire.

private void sendCompressedObjectMessageUsingOpenWire() throws Exception {
    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    ActiveMQDestination destination = createDestination(session, ActiveMQDestination.QUEUE_TYPE);
    final ActiveMQMessageProducer producer = (ActiveMQMessageProducer) session.createProducer(destination);
    ObjectMessage objectMessage = session.createObjectMessage();
    objectMessage.setObject(TEXT);
    producer.send(objectMessage);
}
Also used : ObjectMessage(javax.jms.ObjectMessage) ActiveMQMessageProducer(org.apache.activemq.ActiveMQMessageProducer) Session(javax.jms.Session) ActiveMQDestination(org.apache.activemq.command.ActiveMQDestination)

Aggregations

Session (javax.jms.Session)12 ActiveMQMessageProducer (org.apache.activemq.ActiveMQMessageProducer)12 ActiveMQDestination (org.apache.activemq.command.ActiveMQDestination)12 TextMessage (javax.jms.TextMessage)3 BytesMessage (javax.jms.BytesMessage)2 MapMessage (javax.jms.MapMessage)2 ObjectMessage (javax.jms.ObjectMessage)2 StreamMessage (javax.jms.StreamMessage)2