本文整理汇总了Java中org.springframework.amqp.core.Queue.setAdminsThatShouldDeclare方法的典型用法代码示例。如果您正苦于以下问题:Java Queue.setAdminsThatShouldDeclare方法的具体用法?Java Queue.setAdminsThatShouldDeclare怎么用?Java Queue.setAdminsThatShouldDeclare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.amqp.core.Queue
的用法示例。
在下文中一共展示了Queue.setAdminsThatShouldDeclare方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRequest
import org.springframework.amqp.core.Queue; //导入方法依赖的package包/类
@Test
public void testRequest()
{
Queue queue = new Queue("test");
queue.setAdminsThatShouldDeclare(rabbitAdmin);
rabbitAdmin.getQueueProperties("test");
PowerMock.expectLastCall().andAnswer(() ->
{
Properties properties = new Properties();
properties.setProperty("QUEUE_CONSUMER_COUNT", "2");
properties.setProperty("QUEUE_MESSAGE_COUNT", "234");
return properties;
});
PowerMock.replayAll();
RabbitQueueProperties queueProperties = propertiesManager.request(queue);
PowerMock.verifyAll();
Assert.assertEquals(2, queueProperties.getConsumerCount());
Assert.assertEquals(234, queueProperties.getMessageCount());
}
开发者ID:julian-eggers,项目名称:spring-rabbitmq-actuator,代码行数:23,代码来源:RabbitQueuePropertiesManagerTest.java
示例2: testConstructor
import org.springframework.amqp.core.Queue; //导入方法依赖的package包/类
@Test
public void testConstructor()
{
CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory);
Queue queue = new Queue("test");
queue.setAdminsThatShouldDeclare(rabbitAdmin);
QueueCheck queueCheck = new QueueCheck(queue, 10000, 2);
Assert.assertEquals(10000, queueCheck.getMaxMessageCount());
Assert.assertEquals(2, queueCheck.getMinConsumerCount());
Assert.assertNotNull(queueCheck.getQueue());
Assert.assertNotNull(queueCheck.getRabbitAdmin());
}
示例3: generateQueue
import org.springframework.amqp.core.Queue; //导入方法依赖的package包/类
public static Queue generateQueue(String name)
{
CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory);
Queue queue = new Queue(name);
queue.setAdminsThatShouldDeclare(rabbitAdmin);
return queue;
}
示例4: testRequestWithFailed
import org.springframework.amqp.core.Queue; //导入方法依赖的package包/类
@Test(expected = RuntimeException.class)
public void testRequestWithFailed()
{
Queue queue = new Queue("test");
queue.setAdminsThatShouldDeclare(rabbitAdmin);
rabbitAdmin.getQueueProperties("test");
PowerMock.expectLastCall().andReturn(null);
PowerMock.replayAll();
propertiesManager.request(queue);
PowerMock.verifyAll();
}
开发者ID:julian-eggers,项目名称:spring-rabbitmq-actuator,代码行数:14,代码来源:RabbitQueuePropertiesManagerTest.java