Tabnine Logo
AsyncRabbitTemplate$RabbitMessageFuture.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.springframework.amqp.rabbit.AsyncRabbitTemplate$RabbitMessageFuture
constructor

Best Java code snippets using org.springframework.amqp.rabbit.AsyncRabbitTemplate$RabbitMessageFuture.<init> (Showing top 4 results out of 315)

origin: spring-projects/spring-integration

@Test
public void testAsyncDelayExpression() {
  ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
  AsyncRabbitTemplate amqpTemplate = spy(new AsyncRabbitTemplate(new RabbitTemplate(connectionFactory),
      new SimpleMessageListenerContainer(connectionFactory), "replyTo"));
  amqpTemplate.setTaskScheduler(mock(TaskScheduler.class));
  AsyncAmqpOutboundGateway gateway = new AsyncAmqpOutboundGateway(amqpTemplate);
  willAnswer(
      invocation -> amqpTemplate.new RabbitMessageFuture("foo", invocation.getArgument(2)))
        .given(amqpTemplate).sendAndReceive(anyString(), anyString(), any(Message.class));
  gateway.setExchangeName("foo");
  gateway.setRoutingKey("bar");
  gateway.setDelayExpressionString("42");
  gateway.setBeanFactory(mock(BeanFactory.class));
  gateway.setOutputChannel(new NullChannel());
  gateway.afterPropertiesSet();
  gateway.start();
  ArgumentCaptor<Message> captor = ArgumentCaptor.forClass(Message.class);
  gateway.handleMessage(new GenericMessage<>("foo"));
  verify(amqpTemplate).sendAndReceive(eq("foo"), eq("bar"), captor.capture());
  assertThat(captor.getValue().getMessageProperties().getDelay(), equalTo(42));
}
origin: spring-projects/spring-integration

RabbitMessageFuture future = asyncTemplate.new RabbitMessageFuture(null, null);
willReturn(future).given(asyncTemplate).sendAndReceive(anyString(), anyString(),
    any(org.springframework.amqp.core.Message.class));
origin: spring-projects/spring-amqp

@Override
public RabbitMessageFuture sendAndReceive(String exchange, String routingKey, Message message) {
  String correlationId = getOrSetCorrelationIdAndSetReplyTo(message);
  RabbitMessageFuture future = new RabbitMessageFuture(correlationId, message);
  CorrelationData correlationData = null;
  if (this.enableConfirms) {
    correlationData = new CorrelationData(correlationId);
    future.setConfirm(new SettableListenableFuture<>());
  }
  this.pending.put(correlationId, future);
  if (this.container != null) {
    this.template.send(exchange, routingKey, message, correlationData);
  }
  else {
    ChannelHolder channelHolder = this.directReplyToContainer.getChannelHolder();
    future.setChannelHolder(channelHolder);
    sendDirect(channelHolder.getChannel(), exchange, routingKey, message, correlationData);
  }
  future.startTimer();
  return future;
}
origin: org.springframework.amqp/spring-rabbit

@Override
public RabbitMessageFuture sendAndReceive(String exchange, String routingKey, Message message) {
  String correlationId = getOrSetCorrelationIdAndSetReplyTo(message);
  RabbitMessageFuture future = new RabbitMessageFuture(correlationId, message);
  CorrelationData correlationData = null;
  if (this.enableConfirms) {
    correlationData = new CorrelationData(correlationId);
    future.setConfirm(new SettableListenableFuture<>());
  }
  this.pending.put(correlationId, future);
  if (this.container != null) {
    this.template.send(exchange, routingKey, message, correlationData);
  }
  else {
    ChannelHolder channelHolder = this.directReplyToContainer.getChannelHolder();
    future.setChannelHolder(channelHolder);
    sendDirect(channelHolder.getChannel(), exchange, routingKey, message, correlationData);
  }
  future.startTimer();
  return future;
}
org.springframework.amqp.rabbitAsyncRabbitTemplate$RabbitMessageFuture<init>

Popular methods of AsyncRabbitTemplate$RabbitMessageFuture

  • getConfirm
  • addCallback
  • getNackCause
  • set
  • setChannelHolder
  • setConfirm
  • startTimer

Popular in Java

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • startActivity (Activity)
  • compareTo (BigDecimal)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • BoxLayout (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Join (org.hibernate.mapping)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now