Package com.rabbitmq.client.AMQP

Examples of com.rabbitmq.client.AMQP.BasicProperties


    container.setShutdownTimeout(100);
    container.setTransactionManager(new RabbitTransactionManager(cachingConnectionFactory));
    container.afterPropertiesSet();
    container.start();

    consumer.get().handleDelivery("qux", new Envelope(1, false, "foo", "bar"), new BasicProperties(), new byte[] {0});

    assertTrue(latch.await(10, TimeUnit.SECONDS));

    Exception e = tooManyChannels.get();
    if (e != null) {
View Full Code Here


        this.mandatoryExpression.getValue(this.evaluationContext, message, Boolean.class);
    MessageProperties messageProperties = message.getMessageProperties();
    if (mandatory) {
      messageProperties.getHeaders().put(PublisherCallbackChannel.RETURN_CORRELATION, this.uuid);
    }
    BasicProperties convertedMessageProperties = this.messagePropertiesConverter
        .fromMessageProperties(messageProperties, encoding);
    channel.basicPublish(exchange, routingKey, mandatory, convertedMessageProperties, message.getBody());
    // Check if commit needed
    if (isChannelLocallyTransacted(channel)) {
      // Transacted channel created by this template -> commit.
View Full Code Here

    Message message = new Message("Hello, world!".getBytes(), messageProperties);
    final AtomicReference<String> replyTo = new AtomicReference<String>();
    final AtomicReference<String> correlationId = new AtomicReference<String>();
    doAnswer(new Answer<Object>() {
      public Object answer(InvocationOnMock invocation) throws Throwable {
        BasicProperties basicProps = (BasicProperties) invocation.getArguments()[3];
        replyTo.set(basicProps.getReplyTo());
        if (standardHeader) {
          correlationId.set(basicProps.getCorrelationId());
        }
        else {
          correlationId.set((String) basicProps.getHeaders().get(CORRELATION_HEADER));
        }
        MessageProperties springProps = new DefaultMessagePropertiesConverter()
            .toMessageProperties(basicProps, null, "UTF-8");
        Message replyMessage = new Message("!dlrow olleH".getBytes(), springProps);
        template.onMessage(replyMessage);
View Full Code Here

    Message message = new Message("Hello, world!".getBytes(), messageProperties);
    final AtomicReference<String> replyTo = new AtomicReference<String>();
    final AtomicReference<String> correlationId = new AtomicReference<String>();
    doAnswer(new Answer<Object>() {
      public Object answer(InvocationOnMock invocation) throws Throwable {
        BasicProperties basicProps = (BasicProperties) invocation.getArguments()[3];
        replyTo.set(basicProps.getReplyTo());
        correlationId.set(basicProps.getCorrelationId());
        MessageProperties springProps = new DefaultMessagePropertiesConverter()
            .toMessageProperties(basicProps, null, "UTF-8");
        Message replyMessage = new Message("!dlrow olleH".getBytes(), springProps);
        template.onMessage(replyMessage);
        return null;
View Full Code Here

    final AtomicInteger count = new AtomicInteger();
    final List<String> nestedReplyTo = new ArrayList<String>();
    final List<String> nestedCorrelation = new ArrayList<String>();
    doAnswer(new Answer<Object>() {
      public Object answer(InvocationOnMock invocation) throws Throwable {
        BasicProperties basicProps = (BasicProperties) invocation.getArguments()[3];
        nestedReplyTo.add(basicProps.getReplyTo());
        nestedCorrelation.add(basicProps.getCorrelationId());
        MessageProperties springProps = new DefaultMessagePropertiesConverter()
            .toMessageProperties(basicProps, null, "UTF-8");
        Message replyMessage = new Message("!dlrow olleH".getBytes(), springProps);
        if (count.incrementAndGet() < 2) {
          Message anotherMessage = new Message("Second".getBytes(), springProps);
View Full Code Here

    Message message = new Message("Hello, world!".getBytes(), messageProperties);
    final AtomicReference<String> replyTo = new AtomicReference<String>();
    final AtomicReference<String> correlationId = new AtomicReference<String>();
    doAnswer(new Answer<Object>() {
      public Object answer(InvocationOnMock invocation) throws Throwable {
        BasicProperties basicProps = (BasicProperties) invocation.getArguments()[3];
        replyTo.set(basicProps.getReplyTo());
        correlationId.set((String) basicProps.getHeaders().get(CORRELATION_HEADER));

        MessageProperties springProps = new DefaultMessagePropertiesConverter()
            .toMessageProperties(basicProps, null, "UTF-8");
        Message replyMessage = new Message("!dlrow olleH".getBytes(), springProps);
        template.onMessage(replyMessage);
View Full Code Here

    final AtomicInteger count = new AtomicInteger();
    final List<String> nestedReplyTo = new ArrayList<String>();
    final List<String> nestedCorrelation = new ArrayList<String>();
    doAnswer(new Answer<Object>() {
      public Object answer(InvocationOnMock invocation) throws Throwable {
        BasicProperties basicProps = (BasicProperties) invocation.getArguments()[3];
        nestedReplyTo.add(basicProps.getReplyTo());
        nestedCorrelation.add(basicProps.getCorrelationId());
        MessageProperties springProps = new DefaultMessagePropertiesConverter()
            .toMessageProperties(basicProps, null, "UTF-8");
        Message replyMessage = new Message("!dlrow olleH".getBytes(), springProps);
        if (count.incrementAndGet() < 2) {
          Message anotherMessage = new Message("Second".getBytes(), springProps);
View Full Code Here

TOP

Related Classes of com.rabbitmq.client.AMQP.BasicProperties

Copyright © 2018 www.massapicom. 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.