Examples of AmqpInboundMessage


Examples of eu.mosaic_cloud.platform.interop.common.amqp.AmqpInboundMessage

        final String correlation = delivery.hasCorrelationId () ? delivery.getCorrelationId () : null;
        final String callback = delivery.hasReplyTo () ? delivery.getReplyTo () : null;
        this.transcript.traceDebugging ("processing a message delivery (of size `%d`) for the consumer `%s` from exchange `%s` with routing key `%s` (with content-type `%s`, content-encoding `%s`, durable `%b`, correlation `%s`, callback `%s`)...", Integer.valueOf (data.length), consumerIdentifier, exchange, routingKey, contentType, contentEncoding, Boolean.valueOf (durable), correlation, callback);
        final IAmqpQueueRawConsumerCallback consumerCallback = this.pendingConsumers.get (consumerIdentifier);
        Preconditions.checkNotNull (consumerIdentifier);
        final AmqpInboundMessage inboundMessage = new AmqpInboundMessage (consumerIdentifier, deliveryTag, exchange, routingKey, data, durable, callback, contentEncoding, contentType, correlation, null);
        consumerCallback.handleDelivery (inboundMessage);
      }
        break;
      case SHUTDOWN : {
        final AmqpPayloads.ShutdownMessage downPayload = (ShutdownMessage) message.payload;
View Full Code Here

Examples of eu.mosaic_cloud.platform.interop.common.amqp.AmqpInboundMessage

      if (consumeCallback != null) {
        final Runnable task = new Runnable () {
          @Override
          public void run ()
          {
            final AmqpInboundMessage message = new AmqpInboundMessage (consumer, envelope.getDeliveryTag (), envelope.getExchange (), envelope.getRoutingKey (), data, ((properties.getDeliveryMode () != null) && (properties.getDeliveryMode () == 2)) ? true : false, properties.getReplyTo (), properties.getContentEncoding (), properties.getContentType (), properties.getCorrelationId (), null);
            consumeCallback.handleDelivery (message);
          }
        };
        AmqpDriver.this.executor.execute (task);
      }
View Full Code Here

Examples of eu.mosaic_cloud.platform.interop.common.amqp.AmqpInboundMessage

  {
    @Override
    public void handleReturn (final int replyCode, final String replyMessage, final String exchange, final String routingKey, final BasicProperties properties, final byte[] data)
        throws IOException
    {
      final AmqpInboundMessage message = new AmqpInboundMessage (null, -1, exchange, routingKey, data, properties.getDeliveryMode () == 2 ? true : false, properties.getReplyTo (), properties.getContentEncoding (), properties.getContentType (), properties.getCorrelationId (), properties.getMessageId ());
      AmqpDriver.this.logger.trace ("AmqpDriver - Received RETURN callback for " + message.getDelivery ()); // $NON-NLS-1$
      // FIXME: We should trigger a `publishFailed` callback, but due to
      //-- the lack of "positive" acknowledgements,
      //-- we just ignore this situation. Maybe we should use the
      //-- RabbitMQ extension for publish acknowledgements.
    }
View Full Code Here

Examples of eu.mosaic_cloud.platform.interop.common.amqp.AmqpInboundMessage

  {
    return new GenericOperation<AmqpInboundMessage> (new Callable<AmqpInboundMessage> () {
      @Override
      public AmqpInboundMessage call ()
      {
        AmqpInboundMessage message = null;
        final String queue = (String) parameters[0];
        final boolean autoAck = (Boolean) parameters[1];
        final String clientId = (String) parameters[2];
        final Channel channel = AmqpOperationFactory.this.amqpDriver.getChannel (clientId);
        if (channel != null) {
          GetResponse outcome = null;
          try {
            outcome = channel.basicGet (queue, autoAck);
            if (outcome != null) {
              final Envelope envelope = outcome.getEnvelope ();
              final AMQP.BasicProperties properties = outcome.getProps ();
              message = new AmqpInboundMessage (null, envelope.getDeliveryTag (), envelope.getExchange (), envelope.getRoutingKey (), outcome.getBody (), properties.getDeliveryMode () == 2 ? true : false, properties.getReplyTo (), properties.getContentEncoding (), properties.getContentType (), properties.getCorrelationId (), properties.getMessageId ());
            }
          } catch (final IOException e) {
            AmqpOperationFactory.this.exceptions.traceIgnoredException (e);
          }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.