Search in sources :

Example 6 with AMQPMessage

use of com.swiftmq.amqp.v100.messaging.AMQPMessage in project swiftmq-ce by iitsoftware.

the class AMQPValueMapMessageFactory method create.

public AMQPMessage create(int sequenceNo) throws Exception {
    AMQPMessage msg = new AMQPMessage();
    Map map = new HashMap();
    map.put(new AMQPString("key1"), new AMQPString("value1"));
    map.put(new AMQPLong(Integer.MAX_VALUE + 1), new AMQPLong(200));
    map.put(new AMQPString("key3"), new AMQPString("value1"));
    map.put(new AMQPLong(Integer.MAX_VALUE + 2), new AMQPLong(400));
    msg.setAmqpValue(new AmqpValue(new AMQPMap(map)));
    return msg;
}
Also used : AMQPMap(com.swiftmq.amqp.v100.types.AMQPMap) HashMap(java.util.HashMap) AMQPLong(com.swiftmq.amqp.v100.types.AMQPLong) AMQPString(com.swiftmq.amqp.v100.types.AMQPString) AMQPMessage(com.swiftmq.amqp.v100.messaging.AMQPMessage) AMQPMap(com.swiftmq.amqp.v100.types.AMQPMap) Map(java.util.Map) HashMap(java.util.HashMap) AmqpValue(com.swiftmq.amqp.v100.generated.messaging.message_format.AmqpValue)

Example 7 with AMQPMessage

use of com.swiftmq.amqp.v100.messaging.AMQPMessage in project swiftmq-ce by iitsoftware.

the class AMQPValueStringMessageFactory method createReplyMessage.

public AMQPMessage createReplyMessage(AMQPMessage request) throws Exception {
    AMQPMessage reply = new AMQPMessage();
    reply.setAmqpValue(new AmqpValue(new AMQPString("RE: " + ((AMQPString) request.getAmqpValue().getValue()).getValue())));
    return reply;
}
Also used : AMQPString(com.swiftmq.amqp.v100.types.AMQPString) AMQPMessage(com.swiftmq.amqp.v100.messaging.AMQPMessage) AmqpValue(com.swiftmq.amqp.v100.generated.messaging.message_format.AmqpValue)

Example 8 with AMQPMessage

use of com.swiftmq.amqp.v100.messaging.AMQPMessage in project swiftmq-ce by iitsoftware.

the class AMQPValueStringMessageFactory method create.

public AMQPMessage create(int sequenceNo) throws Exception {
    AMQPMessage msg = new AMQPMessage();
    msg.setAmqpValue(new AmqpValue(new AMQPString("Message #" + sequenceNo)));
    return msg;
}
Also used : AMQPString(com.swiftmq.amqp.v100.types.AMQPString) AMQPMessage(com.swiftmq.amqp.v100.messaging.AMQPMessage) AmqpValue(com.swiftmq.amqp.v100.generated.messaging.message_format.AmqpValue)

Example 9 with AMQPMessage

use of com.swiftmq.amqp.v100.messaging.AMQPMessage in project swiftmq-ce by iitsoftware.

the class DataMessageFactory method create.

public AMQPMessage create(int sequenceNo) throws Exception {
    AMQPMessage msg = new AMQPMessage();
    msg.addData(new Data(b));
    msg.addData(new Data(b));
    msg.addData(new Data(b));
    return msg;
}
Also used : Data(com.swiftmq.amqp.v100.generated.messaging.message_format.Data) AMQPMessage(com.swiftmq.amqp.v100.messaging.AMQPMessage)

Example 10 with AMQPMessage

use of com.swiftmq.amqp.v100.messaging.AMQPMessage in project swiftmq-ce by iitsoftware.

the class DataMessageFactory method createReplyMessage.

public AMQPMessage createReplyMessage(AMQPMessage request) throws Exception {
    AMQPMessage reply = new AMQPMessage();
    List data = request.getData();
    for (int i = 0; i < data.size(); i++) reply.addData((Data) data.get(i));
    return reply;
}
Also used : List(java.util.List) Data(com.swiftmq.amqp.v100.generated.messaging.message_format.Data) AMQPMessage(com.swiftmq.amqp.v100.messaging.AMQPMessage)

Aggregations

AMQPMessage (com.swiftmq.amqp.v100.messaging.AMQPMessage)56 AMQPString (com.swiftmq.amqp.v100.types.AMQPString)24 AmqpValue (com.swiftmq.amqp.v100.generated.messaging.message_format.AmqpValue)23 TxnIdIF (com.swiftmq.amqp.v100.generated.transactions.coordination.TxnIdIF)20 Properties (com.swiftmq.amqp.v100.generated.messaging.message_format.Properties)19 Map (java.util.Map)13 AddressIF (com.swiftmq.amqp.v100.generated.messaging.message_format.AddressIF)12 HashMap (java.util.HashMap)10 AMQPContext (com.swiftmq.amqp.AMQPContext)9 Data (com.swiftmq.amqp.v100.generated.messaging.message_format.Data)8 AMQPMap (com.swiftmq.amqp.v100.types.AMQPMap)8 JSSESocketFactory (com.swiftmq.net.JSSESocketFactory)8 IOException (java.io.IOException)8 Producer (com.swiftmq.amqp.v100.client.Producer)6 ApplicationProperties (com.swiftmq.amqp.v100.generated.messaging.message_format.ApplicationProperties)6 AMQPBoolean (com.swiftmq.amqp.v100.types.AMQPBoolean)5 List (java.util.List)4 AMQPException (com.swiftmq.amqp.v100.client.AMQPException)3 Connection (com.swiftmq.amqp.v100.client.Connection)3 Session (com.swiftmq.amqp.v100.client.Session)3