- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试测试流程,特别是在引发异常时,但由于某种原因,我在 errorsFromSend
中没有得到任何东西。 channel 。
这里是网关:
@MessagingGateway
public interface Send
{
@Gateway(requestChannel = "sending",
headers = @GatewayHeader(name = "errorChannel", expression = "@errorsFromSend"))
void send(final String s);
}
input = "xyz"
引发异常的转换器:
public class Transformer {
public String transform(final String s) {
if(s.equals("xyz")) {
throw new RuntimeException("xyz");
}
log.debug(s);
return s;
}
private final Logger log = LoggerFactory.getLogger(this.getClass().getName());
}
@RunWith(SpringRunner.class)
@EnableIntegration
@ComponentScan(basePackageClasses= {sample.Send.class})
@ContextConfiguration(classes = {SendWithFlowTestConfiguration.class})
public class SendWithFlowTest {
@Test
public void testReceiving() throws Exception {
// arrange
final String payload1 = "123";
final String payload2 = "ABC";
final String payload3 = "xyz";
// act and assert
send.send(payload3);
send.send(payload1);
send.send(payload2);
Message<?> fromErrorsFromSend = errorsFromSend.receive(100); // returns null!
Assertions.assertThat(fromErrorsFromSend.getPayload()).isEqualTo(payload3);
fromErrorsFromSend = errorsFromSend.receive(0);
Assertions.assertThat(fromErrorsFromSend).isEqualTo(null);
// verify
}
@Autowired
private QueueChannel errorsFromSend;
@Autowired
private Send send;
}
@Configuration
@EnableIntegration
@IntegrationComponentScan
class SendWithFlowTestConfiguration {
@Bean(name = PollerMetadata.DEFAULT_POLLER)
public PollerMetadata poller() {
return Pollers.fixedRate(1)
.maxMessagesPerPoll(1)
.get();
}
@Bean
public DirectChannel receiving() {
return new DirectChannel();
}
@Bean
public QueueChannel sending() {
return new QueueChannel();
}
@Bean
public QueueChannel errorsFromSend() {
return new QueueChannel();
}
@Bean
public Transformer transformer() {
return new Transformer();
}
@Bean
@Value("2")
public TaskExecutor executor(final int poolSize) {
return new TaskExecutorAdapter(Executors.newFixedThreadPool(poolSize));
}
@Bean
public IntegrationFlow flow(@Qualifier("executor") final TaskExecutor executor) {
return IntegrationFlows.from(sending())
.channel(MessageChannels.executor("receiving", executor).get())
.transform(transformer())
.handle(m -> System.out.println(">> " + m.getPayload()))
.get();
}
}
errorsFromSend
channel 没有得到异常?根据 Gary 的建议,这是修剪后的日志:
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
[main ] DEBUG Identified candidate component class: file [C:\stash\sample\bin\main\sample\SampleApplication.class]
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.condition.BeanTypeRegistry'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.AutoConfigurationPackages'
[main ] DEBUG @EnableAutoConfiguration was declared on a class in the package 'sample'. Automatic @Repository and @Entity scanning is enabled.
[main ] DEBUG Identified candidate component class: file [C:\stash\sample\bin\main\sample\Send.class]
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.test.context.ImportsContextCustomizer$ImportsCleanupPostProcessor'
[main ] DEBUG Creating shared instance of singleton bean 'IntegrationConfigurationBeanFactoryPostProcessor'
[main ] DEBUG Creating shared instance of singleton bean 'propertySourcesPlaceholderConfigurer'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.test.mock.mockito.MockitoPostProcessor'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerProcessor'
[main ] DEBUG Creating shared instance of singleton bean 'DefaultConfiguringBeanFactoryPostProcessor'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.context.properties.ConfigurationBeanFactoryMetadata'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerFactory'
[main ] INFO No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
[main ] INFO No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created.
[main ] DEBUG SpEL function '#xpath' isn't registered: there is no spring-integration-xml.jar on the classpath.
[main ] INFO No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.test.mock.mockito.MockitoPostProcessor$SpyPostProcessor'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.aop.config.internalAutoProxyCreator'
[main ] DEBUG Creating shared instance of singleton bean 'persistenceExceptionTranslationPostProcessor'
[main ] DEBUG Autowiring by type from bean name 'persistenceExceptionTranslationPostProcessor' via factory method to bean named 'environment'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.integration.internalMessagingAnnotationPostProcessor'
[main ] DEBUG Creating shared instance of singleton bean 'integrationDisposableAutoCreatedBeans'
[main ] INFO Bean 'integrationDisposableAutoCreatedBeans' of type [org.springframework.integration.config.annotation.Disposables] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[main ] DEBUG Creating shared instance of singleton bean 'integrationManagementConfigurer'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.integration.config.IntegrationManagementConfiguration'
[main ] INFO Bean 'org.springframework.integration.config.IntegrationManagementConfiguration' of type [org.springframework.integration.config.IntegrationManagementConfiguration$$EnhancerBySpringCGLIB$$7474d083] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.integration.dsl.context.IntegrationFlowBeanPostProcessor'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.integration.dsl.IntegrationFlowDefinition$ReplyProducerCleaner'
[main ] DEBUG Creating shared instance of singleton bean 'globalChannelInterceptorProcessor'
[main ] DEBUG Creating shared instance of singleton bean 'sendWithFlowTestConfiguration'
[main ] DEBUG Creating shared instance of singleton bean 'sampleApplication'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.integration.context.defaultPollerMetadata'
[main ] DEBUG Creating shared instance of singleton bean 'receiving'
[main ] DEBUG Creating shared instance of singleton bean 'integrationGlobalProperties'
[main ] DEBUG Creating shared instance of singleton bean 'messageBuilderFactory'
[main ] DEBUG Creating shared instance of singleton bean 'mergedIntegrationGlobalProperties'
[main ] DEBUG Creating shared instance of singleton bean 'datatypeChannelMessageConverter'
[main ] DEBUG Creating shared instance of singleton bean 'sending'
[main ] DEBUG Creating shared instance of singleton bean 'errorsFromSend'
[main ] DEBUG Creating shared instance of singleton bean 'transformer'
[main ] DEBUG Creating shared instance of singleton bean 'executor'
[main ] DEBUG Creating shared instance of singleton bean 'flow'
[main ] DEBUG Autowiring by type from bean name 'flow' via factory method to bean named 'executor'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.integration.dsl.context.IntegrationFlowContext'
[main ] DEBUG Creating shared instance of singleton bean 'flow.bridge#0'
[main ] DEBUG Creating shared instance of singleton bean 'flow.org.springframework.integration.config.ConsumerEndpointFactoryBean#0'
[main ] DEBUG Creating shared instance of singleton bean 'flow.org.springframework.integration.transformer.MethodInvokingTransformer#0'
[main ] DEBUG Creating shared instance of singleton bean 'flow.transformer#0'
[main ] DEBUG Creating shared instance of singleton bean 'flow.org.springframework.integration.config.ConsumerEndpointFactoryBean#1'
[main ] DEBUG Creating shared instance of singleton bean 'flow.channel#0'
[main ] DEBUG Creating shared instance of singleton bean 'flow.p2.SendWithFlowTestConfiguration$$Lambda$123/1338368149#0'
[main ] DEBUG Creating shared instance of singleton bean 'flow.org.springframework.integration.config.ConsumerEndpointFactoryBean#2'
[main ] DEBUG Creating shared instance of singleton bean 'channelInitializer'
[main ] DEBUG Creating shared instance of singleton bean '$autoCreateChannelCandidates'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration'
[main ] DEBUG Creating shared instance of singleton bean 'mbeanExporter'
[main ] DEBUG Creating shared instance of singleton bean 'objectNamingStrategy'
[main ] DEBUG Autowiring by type from bean name 'mbeanExporter' via factory method to bean named 'objectNamingStrategy'
[main ] DEBUG Creating shared instance of singleton bean 'mbeanServer'
[main ] DEBUG Found MBeanServer: com.sun.jmx.mbeanserver.JmxMBeanServer@5778826f
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.aop.AopAutoConfiguration$CglibAutoProxyConfiguration'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.aop.AopAutoConfiguration'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration'
[main ] DEBUG Cannot find '.class' file for class [class org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration$$EnhancerBySpringCGLIB$$457d226d] - unable to determine constructor/method parameter names
[main ] DEBUG Creating shared instance of singleton bean 'spring.info-org.springframework.boot.autoconfigure.info.ProjectInfoProperties'
[main ] DEBUG Autowiring by type from bean name 'org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration' via constructor to bean named 'spring.info-org.springframework.boot.autoconfigure.info.ProjectInfoProperties'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationComponentScanConfiguration'
[main ] DEBUG Creating shared instance of singleton bean 'send'
[main ] DEBUG Creating shared instance of singleton bean 'integrationEvaluationContext'
[main ] DEBUG Creating shared instance of singleton bean 'jsonPath'
[main ] DEBUG Creating shared instance of singleton bean 'taskScheduler'
[main ] INFO Initializing ExecutorService 'taskScheduler'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationManagementConfiguration$EnableIntegrationManagementConfiguration'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationManagementConfiguration'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationConfiguration'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration'
[main ] DEBUG Creating shared instance of singleton bean 'spring.integration-org.springframework.boot.autoconfigure.integration.IntegrationProperties'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.reactor.core.ReactorCoreAutoConfiguration'
[main ] DEBUG Creating shared instance of singleton bean 'spring.reactor-org.springframework.boot.autoconfigure.reactor.core.ReactorCoreProperties'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration'
[main ] DEBUG Cannot find '.class' file for class [class org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration$$EnhancerBySpringCGLIB$$9522ae2a] - unable to determine constructor/method parameter names
[main ] DEBUG Creating shared instance of singleton bean 'spring.task.execution-org.springframework.boot.autoconfigure.task.TaskExecutionProperties'
[main ] DEBUG Autowiring by type from bean name 'org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration' via constructor to bean named 'spring.task.execution-org.springframework.boot.autoconfigure.task.TaskExecutionProperties'
[main ] DEBUG Creating shared instance of singleton bean 'taskExecutorBuilder'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration'
[main ] DEBUG Creating shared instance of singleton bean 'taskSchedulerBuilder'
[main ] DEBUG Creating shared instance of singleton bean 'spring.task.scheduling-org.springframework.boot.autoconfigure.task.TaskSchedulingProperties'
[main ] DEBUG Autowiring by type from bean name 'taskSchedulerBuilder' via factory method to bean named 'spring.task.scheduling-org.springframework.boot.autoconfigure.task.TaskSchedulingProperties'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration'
[main ] DEBUG Creating shared instance of singleton bean 'platformTransactionManagerCustomizers'
[main ] DEBUG Creating shared instance of singleton bean 'spring.transaction-org.springframework.boot.autoconfigure.transaction.TransactionProperties'
[main ] DEBUG Creating shared instance of singleton bean 'nullChannel'
[main ] DEBUG Creating shared instance of singleton bean 'errorChannel'
[main ] DEBUG Creating shared instance of singleton bean '_org.springframework.integration.errorLogger.handler'
[main ] DEBUG Creating shared instance of singleton bean '_org.springframework.integration.errorLogger'
[main ] DEBUG Creating shared instance of singleton bean 'integrationSimpleEvaluationContext'
[main ] DEBUG Creating shared instance of singleton bean 'org.springframework.integration.config.IdGeneratorConfigurer#0'
[main ] DEBUG Creating shared instance of singleton bean 'integrationLifecycleRoleController'
[main ] DEBUG Creating shared instance of singleton bean 'integrationHeaderChannelRegistry'
[main ] DEBUG Creating shared instance of singleton bean 'integrationArgumentResolverMessageConverter'
[main ] DEBUG Creating shared instance of singleton bean 'integrationArgumentResolvers'
[main ] DEBUG Creating shared instance of singleton bean 'integrationListArgumentResolvers'
[main ] DEBUG
Spring Integration global properties:
spring.integration.endpoints.noAutoStartup=
spring.integration.taskScheduler.poolSize=10
spring.integration.channels.maxUnicastSubscribers=0x7fffffff
spring.integration.channels.autoCreate=true
spring.integration.channels.maxBroadcastSubscribers=0x7fffffff
spring.integration.readOnly.headers=
spring.integration.messagingTemplate.throwExceptionOnLateReply=false
[main ] DEBUG Registering beans for JMX exposure on startup
[main ] DEBUG Autodetecting user-defined JMX MBeans
[main ] DEBUG No global channel interceptors.
[main ] DEBUG Starting beans in phase -2147483648
[main ] INFO Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
[main ] INFO Channel 'org.springframework.context.support.GenericApplicationContext@530612ba.errorChannel' has 1 subscriber(s).
[main ] INFO started _org.springframework.integration.errorLogger
[main ] DEBUG Successfully started bean '_org.springframework.integration.errorLogger'
[main ] INFO Adding {transformer} as a subscriber to the 'receiving' channel
[main ] INFO Channel 'receiving' has 1 subscriber(s).
[main ] INFO started flow.org.springframework.integration.config.ConsumerEndpointFactoryBean#1
[main ] DEBUG Successfully started bean 'flow.org.springframework.integration.config.ConsumerEndpointFactoryBean#1'
[main ] INFO Channel 'org.springframework.context.support.GenericApplicationContext@530612ba.flow.channel#0' has 1 subscriber(s).
[main ] INFO started flow.org.springframework.integration.config.ConsumerEndpointFactoryBean#2
[main ] DEBUG Successfully started bean 'flow.org.springframework.integration.config.ConsumerEndpointFactoryBean#2'
[main ] DEBUG Starting beans in phase 0
[main ] INFO started send
[main ] INFO started send
[main ] DEBUG Successfully started bean 'send'
[main ] DEBUG Starting beans in phase 1073741823
[main ] INFO started flow.org.springframework.integration.config.ConsumerEndpointFactoryBean#0
[main ] DEBUG Successfully started bean 'flow.org.springframework.integration.config.ConsumerEndpointFactoryBean#0'
[main ] DEBUG preSend on channel 'sending', message: GenericMessage [payload=xyz, headers={errorChannel=errorsFromSend, id=b4856e59-ef18-f9dc-bd24-fcbc4f733d2d, timestamp=1544719739311}]
[main ] DEBUG postSend (sent=true) on channel 'sending', message: GenericMessage [payload=xyz, headers={errorChannel=errorsFromSend, id=b4856e59-ef18-f9dc-bd24-fcbc4f733d2d, timestamp=1544719739311}]
[cheduler-1] DEBUG postReceive on channel 'sending', message: GenericMessage [payload=xyz, headers={errorChannel=errorsFromSend, id=b4856e59-ef18-f9dc-bd24-fcbc4f733d2d, timestamp=1544719739311}]
[cheduler-1] DEBUG Poll resulted in Message: GenericMessage [payload=xyz, headers={errorChannel=errorsFromSend, id=b4856e59-ef18-f9dc-bd24-fcbc4f733d2d, timestamp=1544719739311}]
[main ] DEBUG preSend on channel 'sending', message: GenericMessage [payload=123, headers={errorChannel=errorsFromSend, id=58c31c06-fe11-59cc-df6a-3dd55668998e, timestamp=1544719739312}]
[cheduler-1] DEBUG flow.bridge#0 received message: GenericMessage [payload=xyz, headers={errorChannel=errorsFromSend, id=b4856e59-ef18-f9dc-bd24-fcbc4f733d2d, timestamp=1544719739311}]
[main ] DEBUG postSend (sent=true) on channel 'sending', message: GenericMessage [payload=123, headers={errorChannel=errorsFromSend, id=58c31c06-fe11-59cc-df6a-3dd55668998e, timestamp=1544719739312}]
[main ] DEBUG preSend on channel 'sending', message: GenericMessage [payload=ABC, headers={errorChannel=errorsFromSend, id=b99fbb33-dcc7-b353-8f6a-310fc1b94a47, timestamp=1544719739313}]
[cheduler-1] DEBUG preSend on channel 'receiving', message: GenericMessage [payload=xyz, headers={errorChannel=errorsFromSend, id=b4856e59-ef18-f9dc-bd24-fcbc4f733d2d, timestamp=1544719739311}]
[main ] DEBUG postSend (sent=true) on channel 'sending', message: GenericMessage [payload=ABC, headers={errorChannel=errorsFromSend, id=b99fbb33-dcc7-b353-8f6a-310fc1b94a47, timestamp=1544719739313}]
[cheduler-1] DEBUG postSend (sent=true) on channel 'receiving', message: GenericMessage [payload=xyz, headers={errorChannel=errorsFromSend, id=b4856e59-ef18-f9dc-bd24-fcbc4f733d2d, timestamp=1544719739311}]
[1-thread-1] DEBUG flow.transformer#0 received message: GenericMessage [payload=xyz, headers={errorChannel=errorsFromSend, id=b4856e59-ef18-f9dc-bd24-fcbc4f733d2d, timestamp=1544719739311}]
[cheduler-1] DEBUG postReceive on channel 'sending', message: GenericMessage [payload=123, headers={errorChannel=errorsFromSend, id=58c31c06-fe11-59cc-df6a-3dd55668998e, timestamp=1544719739312}]
[cheduler-1] DEBUG Poll resulted in Message: GenericMessage [payload=123, headers={errorChannel=errorsFromSend, id=58c31c06-fe11-59cc-df6a-3dd55668998e, timestamp=1544719739312}]
[cheduler-1] DEBUG flow.bridge#0 received message: GenericMessage [payload=123, headers={errorChannel=errorsFromSend, id=58c31c06-fe11-59cc-df6a-3dd55668998e, timestamp=1544719739312}]
[cheduler-1] DEBUG preSend on channel 'receiving', message: GenericMessage [payload=123, headers={errorChannel=errorsFromSend, id=58c31c06-fe11-59cc-df6a-3dd55668998e, timestamp=1544719739312}]
[cheduler-1] DEBUG postSend (sent=true) on channel 'receiving', message: GenericMessage [payload=123, headers={errorChannel=errorsFromSend, id=58c31c06-fe11-59cc-df6a-3dd55668998e, timestamp=1544719739312}]
[1-thread-2] DEBUG flow.transformer#0 received message: GenericMessage [payload=123, headers={errorChannel=errorsFromSend, id=58c31c06-fe11-59cc-df6a-3dd55668998e, timestamp=1544719739312}]
[cheduler-2] DEBUG postReceive on channel 'sending', message: GenericMessage [payload=ABC, headers={errorChannel=errorsFromSend, id=b99fbb33-dcc7-b353-8f6a-310fc1b94a47, timestamp=1544719739313}]
[cheduler-2] DEBUG Poll resulted in Message: GenericMessage [payload=ABC, headers={errorChannel=errorsFromSend, id=b99fbb33-dcc7-b353-8f6a-310fc1b94a47, timestamp=1544719739313}]
[cheduler-2] DEBUG flow.bridge#0 received message: GenericMessage [payload=ABC, headers={errorChannel=errorsFromSend, id=b99fbb33-dcc7-b353-8f6a-310fc1b94a47, timestamp=1544719739313}]
[cheduler-2] DEBUG preSend on channel 'receiving', message: GenericMessage [payload=ABC, headers={errorChannel=errorsFromSend, id=b99fbb33-dcc7-b353-8f6a-310fc1b94a47, timestamp=1544719739313}]
[cheduler-2] DEBUG postSend (sent=true) on channel 'receiving', message: GenericMessage [payload=ABC, headers={errorChannel=errorsFromSend, id=b99fbb33-dcc7-b353-8f6a-310fc1b94a47, timestamp=1544719739313}]
[1-thread-2] DEBUG 123
[1-thread-2] DEBUG preSend on channel 'flow.channel#0', message: GenericMessage [payload=123, headers={errorChannel=errorsFromSend, id=821dad29-8be4-5a5f-7369-d1393fb5790a, timestamp=1544719739319}]
>> 123
[1-thread-2] DEBUG postSend (sent=true) on channel 'flow.channel#0', message: GenericMessage [payload=123, headers={errorChannel=errorsFromSend, id=821dad29-8be4-5a5f-7369-d1393fb5790a, timestamp=1544719739319}]
[1-thread-2] DEBUG flow.transformer#0 received message: GenericMessage [payload=ABC, headers={errorChannel=errorsFromSend, id=b99fbb33-dcc7-b353-8f6a-310fc1b94a47, timestamp=1544719739313}]
[1-thread-2] DEBUG ABC
>> ABC
[1-thread-2] DEBUG preSend on channel 'flow.channel#0', message: GenericMessage [payload=ABC, headers={errorChannel=errorsFromSend, id=9aca3eed-c695-2054-ff18-5b1c62f60158, timestamp=1544719739319}]
[1-thread-2] DEBUG postSend (sent=true) on channel 'flow.channel#0', message: GenericMessage [payload=ABC, headers={errorChannel=errorsFromSend, id=9aca3eed-c695-2054-ff18-5b1c62f60158, timestamp=1544719739319}]
Exception in thread "pool-1-thread-1"
org.springframework.integration.transformer.MessageTransformationException: Failed to transform Message; nested exception is org.springframework.messaging.MessageHandlingException: nested exception is java.lang.RuntimeException: xyz, failedMessage=GenericMessage [payload=xyz, headers={errorChannel=errorsFromSend, id=b4856e59-ef18-f9dc-bd24-fcbc4f733d2d, timestamp=1544719739311}], failedMessage=GenericMessage [payload=xyz, headers={errorChannel=errorsFromSend, id=b4856e59-ef18-f9dc-bd24-fcbc4f733d2d, timestamp=1544719739311}]
at org.springframework.integration.transformer.MessageTransformingHandler.handleRequestMessage(MessageTransformingHandler.java:114)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:123)
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:162)
at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:115)
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:133)
at org.springframework.integration.dispatcher.UnicastingDispatcher.access$000(UnicastingDispatcher.java:53)
at org.springframework.integration.dispatcher.UnicastingDispatcher$1.run(UnicastingDispatcher.java:114)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.messaging.MessageHandlingException: nested exception is java.lang.RuntimeException: xyz, failedMessage=GenericMessage [payload=xyz, headers={errorChannel=errorsFromSend, id=b4856e59-ef18-f9dc-bd24-fcbc4f733d2d, timestamp=1544719739311}]
at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:107)
at org.springframework.integration.transformer.AbstractMessageProcessingTransformer.transform(AbstractMessageProcessingTransformer.java:113)
at org.springframework.integration.transformer.MessageTransformingHandler.handleRequestMessage(MessageTransformingHandler.java:108)
... 9 more
Caused by: java.lang.RuntimeException: xyz
at sample.Transformer.transform(Transformer.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:170)
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:120)
at org.springframework.integration.handler.support.MessagingMethodInvokerHelper$HandlerMethod.invoke(MessagingMethodInvokerHelper.java:1087)
at org.springframework.integration.handler.support.MessagingMethodInvokerHelper.invokeHandlerMethod(MessagingMethodInvokerHelper.java:584)
at org.springframework.integration.handler.support.MessagingMethodInvokerHelper.processInternal(MessagingMethodInvokerHelper.java:473)
at org.springframework.integration.handler.support.MessagingMethodInvokerHelper.process(MessagingMethodInvokerHelper.java:317)
at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:104)
... 11 more
最佳答案
Caused by: org.springframework.messaging.MessageHandlingException: nested exception is java.lang.RuntimeException: xyz, failedMessage=GenericMessage [payload=xyz, headers={errorChannel=errorsFromSend, id=38b35bcb-61f1-7be4-c523-499d8fa13db7, timestamp=1544808482872}]
ErrorHandlingTaskExecutor
中.
@Bean
public IntegrationFlow flow(@Qualifier("executor") final TaskExecutor executor)
{
return IntegrationFlows.from(sending())
.channel(execChannel(executor))
.transform(transformer())
.handle(m -> System.out.println(">> " + m.getPayload()))
.get();
}
@Bean
public ExecutorChannel execChannel(final TaskExecutor executor) {
return MessageChannels.executor("receiving", executor).get();
}
@Bean
)。
sending()
一个执行者 channel 开始。
receiving
的 channel 这使 DSL 感到困惑,因为它发现了一个具有该名称的现有 bean,因此没有初始化 Executor channel 。
关于unit-testing - Spring集成测试流程异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53752767/
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
首先是一些背景;我们正在开发一个数据仓库,并对我们的 ETL 过程使用哪些工具进行一些研究。该团队非常以开发人员为中心,每个人都熟悉 C#。到目前为止,我已经看过 RhinoETL、Pentaho (
我需要具有管理员权限的进程。从this问题和答案来看,似乎没有比启动单独进程更好的方法了。因为我宁愿有一个专用于该过程的过程,而不是仅为此方法在第二个过程中启动我的原始应用程序–我以为我会在VS201
我有这个函数来压平对象 export function flattenObject(object: Object, prefix: string = "") { return Object.key
我正在开发一个基于java的Web应用程序,它要求我使用来自SIP( session 启动协议(protocol))消息的输入生成序列图。我必须表示不同电话和相应服务器之间的调用流程。我可以利用任何工
这是我的代码: Process p=Runtime.getRuntime().exec("something command"); String s; JFrame frame = new JFram
我对 istio 的 mTLS 流程有点困惑。在bookinginfo 示例中,我看到服务通过http 而不是https 进行调用。如果服务之间有 mTLS 那么服务会进行 http 调用吗? 是否可
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
之前做过一个简单的纸牌游戏,对程序的整体流程有自己的想法。我最关心的是卡片触发器。 假设我们有一张名为“Guy”的牌,其效果为“每当你打出另一张牌时,获得 2 点生命”。我将如何将其合并到我的代码中?
我有 4 个 Activity 。 A、B、C 和 D。 用户可以从每个 Activity 开始任何 Activity 。 即 Activity A 有 3 个按钮来启动 B、C 和 D。以同样的方式
我做了一个简单的路由器类,简化后看起来像这样 // @flow import { Container } from 'unstated' type State = { history: Objec
我有两个 Activity ,比如 A1 和 A2。顺序为 A1->A2我从 A1 开始 A2 而没有在 A1 中调用 finish() 。在 A2 中按下后退按钮后,我想在 A1 中触发一个功能。但
我正在考虑在我的下一个项目中使用 BPEL。我试用了 Netbeans BPEL 设计器,我对它很满意。但在我决定使用 BPEL 之前,我想知道它对测试驱动开发的适用程度。不幸的是,我对那个话题知之甚
我需要将两个表格堆叠在一起,前后都有内容。我无法让后面的内容正常流动。堆叠的 table 高度可变。 HTML 结构: ... other content ...
我是 Hibernate 的新手。我无法理解 Hibernate 的流程。请澄清我的疑问。 我有“HibernateUtil.java ”和以下语句 sessionFactory = new Anno
早上好 我开始使用 Ruby,想创建一个小工具来获取我的公共(public) IP 并通过电子邮件发送。我遇到了字符串比较和无法处理的 if/else block 的基本问题。 代码非常简单(见下文)
我目前正尝试在我的团队中建立一个开发流程并阅读有关 GitFlow 的信息。它看起来很有趣,但我可以发现一些问题。 让我们假设以下场景: 我们完成了 F1、F2 和 F3 功能,并将它们 merge
我已经使用 git flow 有一段时间了。我很想了解一个特定的用例。 对于我的一个项目,我有一张新网站功能的门票。此工单取决于许多子任务。我想为主工单创建一个功能分支,然后为每个子任务创建一个脱离父
简介 "终结"一般被分为确定性终结(显示清除)与非确定性终结(隐式清除) 确定性终结主要 提供给开发人员一个显式清理的方法,比如try-finally,using。
你怎么知道在一个程序中已经发现并解决了尽可能多的错误? 几年前我读过一篇关于调试的文档(我认为这是某种 HOWTO)。其中,该文档描述了一种技术,其中编程团队故意将错误添加到代码中并将其传递给 QA
我是一名优秀的程序员,十分优秀!