Search in sources :

Example 6 with com.swiftmq.amqp.v100.generated.transport.definitions

use of com.swiftmq.amqp.v100.generated.transport.definitions in project swiftmq-client by iitsoftware.

the class TransactionController method discharge.

private synchronized void discharge(TxnIdIF txnId, boolean fail) throws AMQPException {
    AMQPMessage msg = new AMQPMessage();
    Discharge discharge = new Discharge();
    discharge.setTxnId(txnId);
    discharge.setFail(new AMQPBoolean(fail));
    msg.setAmqpValue(new AmqpValue(discharge));
    DeliveryStateIF deliveryState = producer.send(msg);
    if (deliveryState instanceof Rejected) {
        Rejected rejected = (Rejected) deliveryState;
        com.swiftmq.amqp.v100.generated.transport.definitions.Error error = rejected.getError();
        if (error != null)
            throw new AMQPException(error.getValueString());
        else
            throw new AMQPException(("Unknown transactiom error"));
    }
}
Also used : DeliveryStateIF(com.swiftmq.amqp.v100.generated.messaging.delivery_state.DeliveryStateIF) Rejected(com.swiftmq.amqp.v100.generated.messaging.delivery_state.Rejected) AMQPBoolean(com.swiftmq.amqp.v100.types.AMQPBoolean) AMQPMessage(com.swiftmq.amqp.v100.messaging.AMQPMessage) AmqpValue(com.swiftmq.amqp.v100.generated.messaging.message_format.AmqpValue)

Aggregations

Error (com.swiftmq.amqp.v100.generated.transport.definitions.Error)3 IOException (java.io.IOException)3 com.swiftmq.amqp.v100.generated.transport.definitions (com.swiftmq.amqp.v100.generated.transport.definitions)2 ConnectionError (com.swiftmq.amqp.v100.generated.transport.definitions.ConnectionError)2 AMQPMessage (com.swiftmq.amqp.v100.messaging.AMQPMessage)2 StreamException (com.rabbitmq.stream.StreamException)1 com.rabbitmq.stream.amqp (com.rabbitmq.stream.amqp)1 DeliveryStateIF (com.swiftmq.amqp.v100.generated.messaging.delivery_state.DeliveryStateIF)1 Rejected (com.swiftmq.amqp.v100.generated.messaging.delivery_state.Rejected)1 com.swiftmq.amqp.v100.generated.messaging.message_format (com.swiftmq.amqp.v100.generated.messaging.message_format)1 AmqpValue (com.swiftmq.amqp.v100.generated.messaging.message_format.AmqpValue)1 AmqpError (com.swiftmq.amqp.v100.generated.transport.definitions.AmqpError)1 SequenceNo (com.swiftmq.amqp.v100.generated.transport.definitions.SequenceNo)1 AMQPBoolean (com.swiftmq.amqp.v100.types.AMQPBoolean)1 AsyncCompletionCallback (com.swiftmq.tools.concurrent.AsyncCompletionCallback)1 Semaphore (com.swiftmq.tools.concurrent.Semaphore)1 DataByteArrayOutputStream (com.swiftmq.tools.util.DataByteArrayOutputStream)1 UnknownHostException (java.net.UnknownHostException)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1