当前位置: 首页>>代码示例>>Java>>正文


Java Queue.setAdminsThatShouldDeclare方法代码示例

本文整理汇总了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());
}
 
开发者ID:julian-eggers,项目名称:spring-rabbitmq-actuator,代码行数:16,代码来源:QueueCheckTest.java

示例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;
}
 
开发者ID:julian-eggers,项目名称:spring-rabbitmq-actuator,代码行数:11,代码来源:QueueUtil.java

示例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


注:本文中的org.springframework.amqp.core.Queue.setAdminsThatShouldDeclare方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。