本文整理匯總了Java中org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.setErrorHandler方法的典型用法代碼示例。如果您正苦於以下問題:Java SimpleMessageListenerContainer.setErrorHandler方法的具體用法?Java SimpleMessageListenerContainer.setErrorHandler怎麽用?Java SimpleMessageListenerContainer.setErrorHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer
的用法示例。
在下文中一共展示了SimpleMessageListenerContainer.setErrorHandler方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getSimpleMessageListenerContainer
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer; //導入方法依賴的package包/類
private SimpleMessageListenerContainer getSimpleMessageListenerContainer(
ConnectionFactory connectionFactory,
@Qualifier("listenerAdapter_vnfmCoreActions") MessageListenerAdapter listenerAdapter,
String queueName_vnfmCoreActions,
int minConcurrency,
int maxConcurrency) {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
container.setConnectionFactory(connectionFactory);
container.setQueueNames(queueName_vnfmCoreActions);
if (minConcurrency <= 0 || maxConcurrency <= 0 || minConcurrency > maxConcurrency) {
container.setConcurrentConsumers(5);
container.setMaxConcurrentConsumers(15);
} else {
container.setConcurrentConsumers(minConcurrency);
container.setMaxConcurrentConsumers(maxConcurrency);
}
container.setMessageListener(listenerAdapter);
container.setErrorHandler(
new ConditionalRejectingErrorHandler(new HandleJsonSyntaxExceptionStrategy()));
return container;
}
示例2: messageListenerContainer
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer; //導入方法依賴的package包/類
/**
* {@link SimpleMessageListenerContainer}のインスタンスを生成します。
* このインスタンスを生成後にRabbitMQへのコネクション{@link #factory()}の設定や
* メッセージ受信側での例外ハンドラ{@link #errorHandler()}の設定、
* リトライ処理{@link #advice()}の設定を行います。
* @return {@link SimpleMessageListenerContainer}のインスタンス
*/
protected SimpleMessageListenerContainer messageListenerContainer() {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
container.setConnectionFactory(factory());
container.setErrorHandler(errorHandler());
container.setAdviceChain(advice());
return container;
}
示例3: ticketingServiceListenerContainer
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer; //導入方法依賴的package包/類
/**
* This bean instantiates and returns the Simple message
* listener container.
*
* @return Simple message listener container
*/
@Bean
SimpleMessageListenerContainer ticketingServiceListenerContainer()
{
final SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
container.setConnectionFactory(rabbitConnectionFactory);
container.setAcknowledgeMode(AcknowledgeMode.AUTO);
container.setQueues(ticketServiceRequestQueue);
container.setMessageListener(ticketingServiceListener());
container.setErrorHandler(new DefaultContainerErrorHandler("ticketingServiceListenerContainer"));
return container;
}
開發者ID:dellemc-symphony,項目名稱:ticketing-service-paqx-parent-sample,代碼行數:18,代碼來源:TicketingServiceConsumerConfig.java
示例4: container
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer; //導入方法依賴的package包/類
private SimpleMessageListenerContainer container() {
SimpleMessageListenerContainer c = new SimpleMessageListenerContainer(ctx.getBean(ConnectionFactory.class));
c.setConnectionFactory(ctx.getBean(ConnectionFactory.class));
c.setErrorHandler(ctx.getBean(ErrorHandler.class));
c.setAdviceChain(ctx.getBean(Advice[].class));
return c;
}
示例5: makeContainer
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer; //導入方法依賴的package包/類
private SimpleMessageListenerContainer makeContainer() {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
container.setConnectionFactory(factory());
container.setErrorHandler(errorHandler());
container.setAdviceChain(advice());
return container;
}