com.rabbitmq.client.ConsumerShutdownSignalCallback Java Examples

The following examples show how to use com.rabbitmq.client.ConsumerShutdownSignalCallback. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ConsumerHolderTest.java    From rabbitmq-cdi with MIT License 6 votes vote down vote up
@Test
void activateAndDeactivate() throws IOException, TimeoutException {
  sut = new ConsumerHolder(eventConsumerMock, "queue", false, PREFETCH_COUNT,
      consumerChannelFactoryMock, declarationsListMock, declarerRepositoryMock);
  Assertions.assertEquals("queue", sut.getQueueName());
  Assertions.assertFalse(sut.isAutoAck());
  when(consumerChannelFactoryMock.createChannel()).thenReturn(channelMock);
  sut.activate();
  verify(channelMock).addRecoveryListener(sut);
  verify(declarerRepositoryMock).declare(channelMock, declarationsListMock);
  verify(channelMock, never()).close();
  verify(channelMock).basicConsume(eq("queue"), eq(false), isA(DeliverCallback.class),
      isA(ConsumerShutdownSignalCallback.class));
  sut.deactivate();
  verify(channelMock).close();
}
 
Example #2
Source File: ConsumerHolderTest.java    From rabbitmq-cdi with MIT License 6 votes vote down vote up
@Test
void activateAndDeactivateWithAutoAck() throws IOException, TimeoutException {
  sut = new ConsumerHolder(eventConsumerMock, "queue", true, PREFETCH_COUNT,
      consumerChannelFactoryMock, declarationsListMock, declarerRepositoryMock);
  Assertions.assertEquals("queue", sut.getQueueName());
  Assertions.assertTrue(sut.isAutoAck());
  when(consumerChannelFactoryMock.createChannel()).thenReturn(channelMock);
  sut.activate();
  verify(channelMock).addRecoveryListener(sut);
  verify(channelMock).basicConsume(eq("queue"), eq(true), isA(DeliverCallback.class),
      isA(ConsumerShutdownSignalCallback.class));
  verify(declarerRepositoryMock).declare(channelMock, declarationsListMock);
  verify(channelMock, never()).close();
  verify(channelMock).basicQos(PREFETCH_COUNT);

  sut.deactivate();
  verify(channelMock).close();
}
 
Example #3
Source File: ConsumerHolderTest.java    From rabbitmq-cdi with MIT License 5 votes vote down vote up
@Test
void errorDuringActivate() {
  Assertions.assertThrows(IOException.class, () -> {
    sut = new ConsumerHolder(eventConsumerMock, "queue", true, 0, consumerChannelFactoryMock,
        declarationsListMock, declarerRepositoryMock);
    when(consumerChannelFactoryMock.createChannel()).thenReturn(channelMock);
    doThrow(new IOException()).when(channelMock).basicConsume(eq("queue"), eq(true),
        isA(DeliverCallback.class), isA(ConsumerShutdownSignalCallback.class));
    sut.activate();
    verify(channelMock).addRecoveryListener(sut);
    verify(declarerRepositoryMock).declare(channelMock, declarationsListMock);
    verify(channelMock).close();
  });
}
 
Example #4
Source File: TestChannel.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException {
    throw new UnsupportedOperationException("This method is not currently supported as it is not used by current API in testing");
}
 
Example #5
Source File: PoolableChannel.java    From jweb-cms with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, String consumerTag, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException {
    return delegate.basicConsume(queue, autoAck, consumerTag, deliverCallback, cancelCallback, shutdownSignalCallback);
}
 
Example #6
Source File: PoolableChannel.java    From jweb-cms with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, String consumerTag, boolean noLocal, boolean exclusive, Map<String, Object> arguments, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException {
    return delegate.basicConsume(queue, autoAck, consumerTag, noLocal, exclusive, arguments, deliverCallback, shutdownSignalCallback);
}
 
Example #7
Source File: PoolableChannel.java    From jweb-cms with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, String consumerTag, boolean noLocal, boolean exclusive, Map<String, Object> arguments, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException {
    return delegate.basicConsume(queue, autoAck, consumerTag, noLocal, exclusive, arguments, deliverCallback, cancelCallback, shutdownSignalCallback);
}
 
Example #8
Source File: TestChannel.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException {
    throw new UnsupportedOperationException("This method is not currently supported as it is not used by current API in testing");
}
 
Example #9
Source File: TestChannel.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException {
    throw new UnsupportedOperationException("This method is not currently supported as it is not used by current API in testing");
}
 
Example #10
Source File: PoolableChannel.java    From jweb-cms with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, String consumerTag, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException {
    return delegate.basicConsume(queue, autoAck, consumerTag, deliverCallback, shutdownSignalCallback);
}
 
Example #11
Source File: TestChannel.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback)
    throws IOException {
    throw new UnsupportedOperationException("This method is not currently supported as it is not used by current API in testing");
}
 
Example #12
Source File: TestChannel.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, Map<String, Object> arguments, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback)
    throws IOException {
    throw new UnsupportedOperationException("This method is not currently supported as it is not used by current API in testing");
}
 
Example #13
Source File: TestChannel.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, Map<String, Object> arguments, DeliverCallback deliverCallback, CancelCallback cancelCallback,
    ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException {
    throw new UnsupportedOperationException("This method is not currently supported as it is not used by current API in testing");
}
 
Example #14
Source File: TestChannel.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, String consumerTag, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException {
    throw new UnsupportedOperationException("This method is not currently supported as it is not used by current API in testing");
}
 
Example #15
Source File: TestChannel.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, String consumerTag, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback)
    throws IOException {
    throw new UnsupportedOperationException("This method is not currently supported as it is not used by current API in testing");
}
 
Example #16
Source File: TestChannel.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, String consumerTag, boolean noLocal, boolean exclusive, Map<String, Object> arguments, DeliverCallback deliverCallback,
    ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException {
    throw new UnsupportedOperationException("This method is not currently supported as it is not used by current API in testing");
}
 
Example #17
Source File: TestChannel.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, String consumerTag, boolean noLocal, boolean exclusive, Map<String, Object> arguments, DeliverCallback deliverCallback,
    CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException {
    throw new UnsupportedOperationException("This method is not currently supported as it is not used by current API in testing");
}
 
Example #18
Source File: MockChannel.java    From rabbitmq-mock with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, String consumerTag, boolean noLocal, boolean exclusive, Map<String, Object> arguments, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) {
    return basicConsume(queue, autoAck, consumerTag, noLocal, exclusive, arguments, deliverCallback, null, shutdownSignalCallback);
}
 
Example #19
Source File: MockChannel.java    From rabbitmq-mock with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) {
    return basicConsume(queue, false, deliverCallback, shutdownSignalCallback);
}
 
Example #20
Source File: MockChannel.java    From rabbitmq-mock with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) {
    return basicConsume(queue, false, deliverCallback, cancelCallback, shutdownSignalCallback);
}
 
Example #21
Source File: MockChannel.java    From rabbitmq-mock with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) {
    return basicConsume(queue, autoAck, Collections.emptyMap(), deliverCallback, shutdownSignalCallback);
}
 
Example #22
Source File: MockChannel.java    From rabbitmq-mock with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) {
    return basicConsume(queue, autoAck, Collections.emptyMap(), deliverCallback, cancelCallback, shutdownSignalCallback);
}
 
Example #23
Source File: MockChannel.java    From rabbitmq-mock with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, Map<String, Object> arguments, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) {
    return basicConsume(queue, autoAck, arguments, deliverCallback, null, shutdownSignalCallback);
}
 
Example #24
Source File: MockChannel.java    From rabbitmq-mock with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, Map<String, Object> arguments, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) {
    return basicConsume(queue, autoAck, "", false, false, arguments, deliverCallback, cancelCallback, shutdownSignalCallback);
}
 
Example #25
Source File: MockChannel.java    From rabbitmq-mock with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, String consumerTag, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) {
    return basicConsume(queue, autoAck, consumerTag, deliverCallback, null, shutdownSignalCallback);
}
 
Example #26
Source File: MockChannel.java    From rabbitmq-mock with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, String consumerTag, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) {
    return basicConsume(queue, autoAck, consumerTag, false, false, Collections.emptyMap(), deliverCallback, cancelCallback, shutdownSignalCallback);
}
 
Example #27
Source File: ConsumerWrapper.java    From rabbitmq-mock with Apache License 2.0 4 votes vote down vote up
public ConsumerWrapper(DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) {
    this.deliverCallback = deliverCallback;
    this.cancelCallback = cancelCallback;
    this.shutdownSignalCallback = shutdownSignalCallback;
}
 
Example #28
Source File: MockChannel.java    From rabbitmq-mock with Apache License 2.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, boolean autoAck, String consumerTag, boolean noLocal, boolean exclusive, Map<String, Object> arguments, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) {
    return basicConsume(queue, autoAck, consumerTag, noLocal, exclusive, arguments, new ConsumerWrapper(deliverCallback, cancelCallback, shutdownSignalCallback));
}
 
Example #29
Source File: PoolableChannel.java    From jweb-cms with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException {
    return delegate.basicConsume(queue, deliverCallback, shutdownSignalCallback);
}
 
Example #30
Source File: PoolableChannel.java    From jweb-cms with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public String basicConsume(String queue, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException {
    return delegate.basicConsume(queue, deliverCallback, cancelCallback, shutdownSignalCallback);
}