lam*_*dar 3 java spring rabbitmq spring-rabbit spring-amqp
使用Spring-AMQP使用RabbitMQ时获得库存.
只需要一种方法来使用Spring-AMQP配置AutomaticRecoveryEnabled和NetworkRecoveryInterval.如果使用本机RabbitMQ库进行开发,可以直接设置这些标记.但我没有找到使用弹簧做同样的解决方法
factory.setAutomaticRecoveryEnabled(true);
factory.setNetworkRecoveryInterval(10000);
Run Code Online (Sandbox Code Playgroud)
使用Spring-AMPQ(需要帮助)
像上面一样,我在尝试使用Spring-AMPQ时没有找到任何这样的方法.这就是我现在正在做的事情.
@Bean(name="listener")
public SimpleMessageListenerContainer listenerContainer()
{
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
container.setConnectionFactory(connectionFactory());
container.setQueueNames(env.getProperty("mb.queue"));
container.setMessageListener(new MessageListenerAdapter(messageListener));
return container;
}
Run Code Online (Sandbox Code Playgroud)
在这方面的任何帮助都非常值得赞赏.提前致谢.
归档时间: |
|
查看次数: |
3076 次 |
最近记录: |