Examples of AmqpOutboundMessage


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

    } catch (final EncodingException exception) {
      this.exceptions.traceDeferredException (exception, "encoding the message failed; deferring!");
      result = CallbackCompletion.createFailure (exception);
    }
    if (result == null) {
      final AmqpOutboundMessage outbound = new AmqpOutboundMessage (this.exchange, this.publishRoutingKey, data, contentEncoding, contentType);
      result = this.raw.publish (outbound);
    }
    return (result);
  }
View Full Code Here

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

    final String routingKey = ConfigUtils.resolveParameter (configuration, "publisher.amqp.routing_key", String.class, "");
    final boolean manadatory = ConfigUtils.resolveParameter (configuration, "publisher.amqp.manadatory", Boolean.class, true);
    final boolean immediate = ConfigUtils.resolveParameter (configuration, "publisher.amqp.immediate", Boolean.class, true);
    final boolean durable = ConfigUtils.resolveParameter (configuration, "publisher.amqp.durable", Boolean.class, false);
    final EncodeOutcome encode = this.encoder.encode (this.sentMessage, null);
    final AmqpOutboundMessage mssg = new AmqpOutboundMessage (exchange, routingKey, encode.data, manadatory, immediate, durable, null, encode.metadata.getContentEncoding (), encode.metadata.getContentType (), null, null);
    Assert.assertTrue (this.awaitSuccess (this.connector.publish (mssg)));
  }
View Full Code Here

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

  {
    Preconditions.checkNotNull (response);
    final DeliveryToken delivery = (DeliveryToken) response.token;
    Preconditions.checkNotNull (delivery);
    Preconditions.checkArgument (delivery.proxy == this);
    final AmqpOutboundMessage outbound;
    try {
      outbound = this.encodeResponse (response);
    } catch (final EncodingException exception) {
      this.exceptions.traceDeferredException (exception, "encoding the message failed; deferring!");
      return (CallbackCompletion.createFailure (exception));
View Full Code Here

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

      rawStream.writeInt (metadataBytes.length);
      rawStream.write (metadataBytes);
      rawStream.writeInt (httpBodyBytes.length);
      rawStream.write (httpBodyBytes);
      final byte[] rawData = rawBytesStream.toByteArray ();
      final AmqpOutboundMessage rawMessage = new AmqpOutboundMessage (token.callbackExchange, token.callbackRoutingKey, rawData, HttpgQueueConnectorProxy.expectedContentEncoding, HttpgQueueConnectorProxy.expectedContentType);
      return (rawMessage);
    } catch (final EncodingException exception) {
      throw (exception);
    } catch (final Throwable exception) {
      throw (new EncodingException ("unexpected exception", exception));
View Full Code Here

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

          correlationId = publish.getCorrelationId ();
        }
        if (publish.hasReplyTo ()) {
          replyTo = publish.getReplyTo ();
        }
        final AmqpOutboundMessage mssg = new AmqpOutboundMessage (exchange, routingKey, dataBytes, mandatory, immediate, durable, replyTo, envelope.getContentEncoding (), envelope.getContentType (), correlationId, null);
        AmqpStub.logger.trace ("AmqpStub - Received request for PUBLISH"); // $NON-NLS-1$
        // NOTE: execute operation
        final DriverOperationFinishedHandler pubHandler = new DriverOperationFinishedHandler (token, session);
        resultBool = driver.basicPublish (token.getClientId (), mssg, pubHandler);
        pubHandler.setDetails (AmqpOperations.PUBLISH, resultBool);
View Full Code Here

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

    final String routingKey = ConfigUtils.resolveParameter (AmqpDriverTest.configuration, "publisher.amqp.routing_key", String.class, "");
    final boolean manadatory = ConfigUtils.resolveParameter (AmqpDriverTest.configuration, "publisher.amqp.manadatory", Boolean.class, true);
    final boolean immediate = ConfigUtils.resolveParameter (AmqpDriverTest.configuration, "publisher.amqp.immediate", Boolean.class, true);
    final boolean durable = ConfigUtils.resolveParameter (AmqpDriverTest.configuration, "publisher.amqp.durable", Boolean.class, false);
    final EncodeOutcome encode = this.encoder.encode (this.sentMessage, null);
    final AmqpOutboundMessage mssg = new AmqpOutboundMessage (exchange, routingKey, encode.data, manadatory, immediate, durable, null, encode.metadata.getContentEncoding (), encode.metadata.getContentType (), null, null);
    final IOperationCompletionHandler<Boolean> handler = new TestLoggingHandler<Boolean> ("publish message");
    final IResult<Boolean> r = this.wrapper.basicPublish (this.clientId, mssg, handler);
    Assert.assertTrue (r.getResult ());
  }
View Full Code Here

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

      @Override
      public Boolean call ()
          throws IOException
      {
        boolean succeeded = false;
        final AmqpOutboundMessage message = (AmqpOutboundMessage) parameters[0];
        final String clientId = (String) parameters[1];
        final Channel channel = AmqpOperationFactory.this.amqpDriver.getChannel (clientId);
        if (channel != null) {
          final AMQP.BasicProperties properties = new AMQP.BasicProperties (message.getContentType (), message.getContentEncoding (), null, message.isDurable () ? 2 : 1, 0, message.getCorrelation (), message.getCallback (), null, message.getIdentifier (), null, null, null, null, null);
          channel.basicPublish (message.getExchange (), message.getRoutingKey (), properties, message.getData ());
          succeeded = true;
        }
        return succeeded;
      }
    });
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.