I'm running localstack setup with docker-compose.yaml and below is the content of docker-compose.yaml
version: "3.8"
services:
localstack:
image: localstack/localstack:latest
container_name: localstack_test
ports:
- "127.0.0.1:4566:4566"
- "127.0.0.1:4463-4499:4463-4499"
environment:
- SERVICES=s3
- DEBUG=1
- DATA_DIR=/tmp/localstack/data
volumes:
- "./.localstack:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
Whenever we try to hit the URL localhost:4566, it returns a blank page in browser and the docker logs are as below.
localstack | 2023-02-08T13:06:25.695 DEBUG --- [ MainThread] plugin.manager : plugin localstack.hooks.on_infra_ready:extensions_on_infra_ready is disabled
localstack | 2023-02-08T13:06:25.695 DEBUG --- [ MainThread] plugin.manager : instantiating plugin PluginSpec(localstack.hooks.on_infra_ready.initialize_health_info = <function initialize_health_info at 0x7fbfdcf48310>)
localstack | 2023-02-08T13:06:25.695 DEBUG --- [ MainThread] plugin.manager : plugin localstack.hooks.on_infra_ready:initialize_health_info is disabled
localstack | 2023-02-08T13:06:34.860 DEBUG --- [ asgi_gw_0] l.aws.handlers.service : no service set in context, skipping request parsing
localstack | 2023-02-08T13:06:34.864 INFO --- [ asgi_gw_0] localstack.request.http : GET / => 200
Can anyone, please let me know what's the issue here ? it was invoking s3 initially without any changes and then restarting docker is causing this. Thanks in advance
I am using testcontainers in a spring boot project (version : 1.17.2) and I am trying to spin up a rabbitmq container. It seems like rabbitmq container starts up successfully, but it releases connection as soon as it is up.
I can see some error in logs but after that I can see that the test container is started. I am kind of flummoxed as to why am I seeing this error and/or if the container is started or not ?
Pasting excerpt from logs :
15:00:44.007 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: 2022-06-29 05:00:24.477316+00:00 [info] <0.703.0> * rabbitmq_management_agent
15:00:44.007 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: 2022-06-29 05:00:24.477316+00:00 [info] <0.703.0> * rabbitmq_web_dispatch
15:00:44.007 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: 2022-06-29 05:00:24.477316+00:00 [info] <0.703.0> * rabbitmq_management
15:00:44.007 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: 2022-06-29 05:00:24.477316+00:00 [info] <0.703.0> * rabbitmq_prometheus
15:00:44.007 [main] DEBUG org.testcontainers.containers.output.WaitingConsumer - STDOUT: 2022-06-29 05:00:24.477316+00:00 [info] <0.703.0> Server startup complete; 4 plugins started.
15:00:44.007 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-0000000C: cancel
15:00:44.007 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.DefaultManagedHttpClientConnection - http-outgoing-1: close connection IMMEDIATE
15:00:44.008 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-0000000C: endpoint closed
15:00:44.008 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.InternalHttpClient - ep-0000000C: discarding endpoint
15:00:44.008 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000C: releasing endpoint
15:00:44.008 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000C: connection is not kept alive
15:00:44.008 [docker-java-stream--540868428] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "end of stream"
15:00:44.008 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager - ep-0000000C: connection released [route: {}->npipe://localhost:2375][total available: 0; route allocated: 0 of 2147483647; total allocated: 0 of 2147483647]
15:00:44.008 [main] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "[read] I/O error: java.nio.channels.ClosedChannelException"
15:00:44.008 [docker-java-stream--540868428] DEBUG com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire - http-outgoing-1 << "[read] I/O error: java.nio.channels.ClosedChannelException"
15:00:44.008 [docker-java-stream--540868428] DEBUG com.github.dockerjava.zerodep.ApacheDockerHttpClientImpl$ApacheResponse - Failed to close the response
java.io.IOException: java.nio.channels.ClosedChannelException
at java.base/java.nio.channels.Channels$2.read(Channels.java:240)
at com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.io.LoggingInputStream.read(LoggingInputStream.java:81)
at com.github.dockerjava.zerodep.shaded.org.apache.hc.core5.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:149)
at com.github.dockerjava.zerodep.shaded.org.apache.hc.core5.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280)
at com.github.dockerjava.zerodep.shaded.org.apache.hc.core5.http.impl.io.ChunkedInputStream.getChunkSize(ChunkedInputStream.java:261)
at com.github.dockerjava.zerodep.shaded.org.apache.hc.core5.http.impl.io.ChunkedInputStream.nextChunk(ChunkedInputStream.java:222)
at com.github.dockerjava.zerodep.shaded.org.apache.hc.core5.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:147)
at com.github.dockerjava.zerodep.shaded.org.apache.hc.core5.http.impl.io.ChunkedInputStream.close(ChunkedInputStream.java:314)
at com.github.dockerjava.zerodep.shaded.org.apache.hc.core5.io.Closer.close(Closer.java:48)
at com.github.dockerjava.zerodep.shaded.org.apache.hc.core5.http.impl.io.IncomingHttpEntity.close(IncomingHttpEntity.java:111)
at com.github.dockerjava.zerodep.shaded.org.apache.hc.core5.http.io.entity.HttpEntityWrapper.close(HttpEntityWrapper.java:120)
at com.github.dockerjava.zerodep.shaded.org.apache.hc.core5.io.Closer.close(Closer.java:48)
at com.github.dockerjava.zerodep.shaded.org.apache.hc.core5.http.message.BasicClassicHttpResponse.close(BasicClassicHttpResponse.java:93)
at com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.impl.classic.CloseableHttpResponse.close(CloseableHttpResponse.java:200)
at com.github.dockerjava.zerodep.ApacheDockerHttpClientImpl$ApacheResponse.close(ApacheDockerHttpClientImpl.java:256)
at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.lambda$executeAndStream$1(DefaultInvocationBuilder.java:277)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.nio.channels.ClosedChannelException: null
....................................
15:00:44.009 [main] INFO 🐳 [rabbitmq:3.9.13-management-alpine] - Container rabbitmq:3.9.13-management-alpine started in PT7.8752359S
Config Java :
public abstract class RabbitMqTestContainerConfiguration {
private static final int RABBITMQ_DEFAULT_PORT = 5672;
#Container
public static RabbitMQContainer rabbitMQContainer = new RabbitMQContainer("rabbitmq:3.9.13-management-alpine")
.withExposedPorts(RABBITMQ_DEFAULT_PORT).withStartupTimeout(Duration.ofMinutes(3));
public static class Initializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
#Override
public void initialize(ConfigurableApplicationContext configurableApplicationContext) {
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(configurableApplicationContext,
"spring.rabbitmq.host=" + rabbitMQContainer.getHost(),
"spring.rabbitmq.port=" + rabbitMQContainer.getMappedPort(RABBITMQ_DEFAULT_PORT),
"spring.rabbitmq.username=" + rabbitMQContainer.getAdminUsername(),
"spring.rabbitmq.password=" + rabbitMQContainer.getAdminPassword());
}
}
} ```
Hello I have an app written in Kotlin and using Spring boot Framework and Apache Camel:
https://camel.apache.org/components/latest/smpp-component.html#_spring_boot_auto_configuration
So I am new in Smpp protocol I am suppuse trying to connecto to SMC simulator so I guess my
"client" should be wait for a message from SMC in this case when I run the application it
appears just stop and anymore. As it just stops I would think something is wrong.
#Bean
fun camelContextConfiguration(): CamelContextConfiguration{
return object : CamelContextConfiguration {
override fun afterApplicationStart(camelContext: CamelContext?) {
logger.info("*********************************************************************************")
//var query : Query?
//val oldRoute : List<Route> = camelContext!!.routes
camelContext!!.routes
//logger.info("Old Routes")
//logger.info(oldRoute.size.toString())
// for(route:Route in oldRoute) {
// logger.info("Route with routeId {} is deleted",route.id)
// camelContext.stopRoute(route.id)
// camelContext.removeRoute(route.id)
// }
camelContext.isUseMDCLogging=true
logger.info("ROUTES")
val routeDefinition = RouteDefinition()
routeDefinition.id="1"
routeDefinition.onException(Exception::class.java).handled(true)
.process(exceptionProcessor())
.end()
routeDefinition.from("smpp://smppclient#smscsim.melroselabs.com:2775?password=password&enquireLinkTimer=3000&transactionTimer=5000&systemId=145244&systemType='Receiver'")
routeDefinition.to("log:com.app.smppdispenser.infraestructure.smpp?showBody=true&showHeaders=true")
routeDefinition.process(messageProcessor())
camelContext.addRouteDefinition(routeDefinition)
//routeDefinition.setHeader("CamelSmppCommandId", constant("query_sm"))
//routeDefinition.setHeader("CamelSmppSequenceNumber", constant("1"))
logger.info("Route is added with routeId {} ",routeDefinition.id)
//}
logger.info("CamelConfiguration afterApplicationStart OK")
}
override fun beforeApplicationStart(camelContext: CamelContext?) {
logger.info("CamelConfiguration beforeApplicationStart")
}
}
}
This is the log>
2021-06-06 10:37:06.824 INFO 5604 --- [ main]
o.a.c.s.boot.CamelContextConfiguration : ROUTES 2021-06-06
10:37:07.538 INFO 5604 --- [ main]
org.jsmpp.session.SMPPSession : Connected to
smscsim.melroselabs.com/18.200.51.80 2021-06-06 10:37:07.541 INFO
5604 --- [ession#31859960] org.jsmpp.session.SMPPSession :
Starting PDUReaderWorker 2021-06-06 10:37:07.817 INFO 5604 --- [
main] org.jsmpp.session.SMPPSession : Other side reports
SMPP interface version 34 2021-06-06 10:37:07.817 INFO 5604 --- [
main] org.jsmpp.session.SMPPSession : Changing processor
degree to 3 2021-06-06 10:37:07.819 INFO 5604 --- [ main]
o.a.camel.component.smpp.SmppConsumer : Connected to:
smpp://145244#smscsim.melroselabs.com:2775 2021-06-06 10:37:07.820
INFO 5604 --- [ main] o.a.camel.spring.SpringCamelContext
: Route: 1 started and consuming from:
smpp://smppclient#smscsim.melroselabs.com:2775?enquireLinkTimer=3000&password=xxxxxx&systemId=145244&systemType=%27Receiver%27&transactionTimer=5000
2021-06-06 10:37:07.821 INFO 5604 --- [ main]
o.a.c.s.boot.CamelContextConfiguration : Route is added with routeId
1 2021-06-06 10:37:07.821 INFO 5604 --- [ main]
o.a.c.s.boot.CamelContextConfiguration : CamelConfiguration
afterApplicationStart OK 2021-06-06 10:37:07.936 INFO 5604 --- [
Thread-2] o.s.w.c.s.GenericWebApplicationContext : Closing
org.springframework.web.context.support.GenericWebApplicationContext#2cf3d63b:
startup date [Sun Jun 06 10:36:55 COT 2021]; root of context hierarchy
2021-06-06 10:37:07.944 INFO 5604 --- [ Thread-2]
o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase
2147483647 2021-06-06 10:37:07.945 INFO 5604 --- [ Thread-2]
o.a.camel.spring.SpringCamelContext : Apache Camel 2.20.1
(CamelContext: camel-1) is shutting down 2021-06-06 10:37:07.946 INFO
5604 --- [ Thread-2] o.a.camel.impl.DefaultShutdownStrategy :
Starting to graceful shutdown 1 routes (timeout 300 seconds)
2021-06-06 10:37:08.163 WARN 5604 --- [ession#31859960]
org.jsmpp.session.SMPPSession : IOException while reading:
Socket Closed 2021-06-06 10:37:08.164 INFO 5604 --- [ - ShutdownTask]
o.a.camel.component.smpp.SmppConsumer : Disconnected from:
smpp://145244#smscsim.melroselabs.com:2775 2021-06-06 10:37:08.164
INFO 5604 --- [ - ShutdownTask] o.a.camel.impl.DefaultShutdownStrategy
: Route: 1 shutdown complete, was consuming from:
smpp://smppclient#smscsim.melroselabs.com:2775?enquireLinkTimer=3000&password=xxxxxx&systemId=145244&systemType=%27Receiver%27&transactionTimer=5000
2021-06-06 10:37:08.165 INFO 5604 --- [ession#31859960]
org.jsmpp.session.SMPPSession : PDUReaderWorker stop
2021-06-06 10:37:08.166 INFO 5604 --- [ Thread-2]
o.a.camel.impl.DefaultShutdownStrategy : Graceful shutdown of 1
routes completed in 0 seconds 2021-06-06 10:37:08.202 INFO 5604 --- [
Thread-2] o.a.camel.spring.SpringCamelContext : Apache Camel
2.20.1 (CamelContext: camel-1) uptime 1.629 seconds 2021-06-06 10:37:08.203 INFO 5604 --- [ Thread-2]
o.a.camel.spring.SpringCamelContext : Apache Camel 2.20.1
(CamelContext: camel-1) is shutdown in 0.257 seconds Process finished
with exit code 0
Edit
I have added thse option: camel.springboot.main-run-controller = true then I see this new line in my log but it finish of the same way.
there are some options:
add a spring boot starter web which starts a web server and keep the application running
use a property as explained here: https://camel.apache.org/camel-spring-boot/3.7.x/spring-boot.html#SpringBoot-Keepingapplicationalive
I want to use my profile 'dev' during the test execution. But when I run tests H2 db cannot be found.
Abstract test class:
#RunWith(SpringRunner.class)
#SpringBootTest(classes = MyServiceStarter.class)
#ActiveProfiles("dev")
public abstract class AbstractModulIntegrationTest { ... }
Properties:
flyway.locations=filesystem:./database/h2
flyway.enabled=true
# hsqldb
spring.datasource.platform=h2
spring.jpa.hibernate.ddl-auto=validate
spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2:./db/gcrs;AUTO_SERVER=TRUE
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.password=
spring.datasource.username=sa
spring.jpa.database=h2
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
When I run test in the output it prints Unable to resolve location: filesystem:./database/h2
2017-03-14 18:05:24.500 INFO 7460 --- [ main] o.f.core.internal.util.VersionPrinter : Flyway 4.0.3 by Boxfuse
2017-03-14 18:05:24.500 INFO 7460 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Started.
2017-03-14 18:05:25.002 INFO 7460 --- [ main] o.f.c.i.dbsupport.DbSupportFactory : Database: jdbc:h2:./db/gcrs (H2 1.4)
2017-03-14 18:05:25.018 WARN 7460 --- [ main] o.f.c.i.u.s.f.FileSystemScanner : Unable to resolve location filesystem:./database/h2
2017-03-14 18:05:25.049 WARN 7460 --- [ main] o.f.c.i.u.s.f.FileSystemScanner : Unable to resolve location filesystem:./database/h2
2017-03-14 18:05:25.049 WARN 7460 --- [ main] o.f.c.i.u.s.f.FileSystemScanner : Unable to resolve location filesystem:./database/h2
2017-03-14 18:05:25.049 INFO 7460 --- [ main] o.f.core.internal.command.DbValidate : Successfully validated 0 migrations (execution time 00:00.006s)
2017-03-14 18:05:25.064 INFO 7460 --- [ main] o.f.core.internal.command.DbMigrate : Current version of schema "PUBLIC": << Empty Schema >>
2017-03-14 18:05:25.064 INFO 7460 --- [ main] o.f.core.internal.command.DbMigrate : Schema "PUBLIC" is up to date. No migration necessary.
2017-03-14 18:05:25.205 INFO 7460 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2017-03-14 18:05:25.220 INFO 7460 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
Spring boot version: 1.5.1.RELEASE
My colleague found the solution. The problem was in the wrong path. This solved my issue:
#SpringBootTest(classes = MyServiceStarter.class, properties = {"flyway.locations=filesystem:../database/h2"})
I have a simple JUnit test in which I am testing errorChannel by hooking up a service activator. However, nothing comes to this channel
the config is as follows,
<int:channel id="in"/>
<int:service-activator id="inSA" input-channel="in" ref="thrower"
output-channel="nullChannel"/>
<bean id="thrower"
class="com.att.datalake.ifr.loader.exceptions.handler.Thrower" />
<int:service-activator input-channel="errorChannel" ref="errorManager"
id="errorMgr" method="handleMessage" />
<bean id="errorManager"
class="com.att.datalake.ifr.loader.exceptions.handlers.ErrorManager"/>
The ErrorMgr is as follows:
public class ErrorManager {
#ServiceActivator
public void handleMessage(Message<MessageHandlingException> exception) {
System.out.println("In cleaner");
}
}
The Thrower class is as follows:
public class Thrower {
public Message<FileMessage> process(final Message<FileMessage> message) throws PublisherException {
System.out.println("In the Thrower SA at:"+new Date());
// get error type
String errorType = (String) message.getHeaders().get("ERROR_TYPE");
if (errorType.equals("PublisherError")) {
System.out.println("*****About to throw");
throw new PublisherException("Simple Publisher Exception at:"+new Date());
}
return message;
}
}
The Thrower SA simply throws an exception, which is reported by JUnit test, but nothing goes to errorChannel
The log in debug is :
2015-01-23 10:53:20.597 DEBUG --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'integrationHeaderChannelRegistry'
2015-01-23 10:53:20.597 DEBUG --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'globalChannelInterceptorProcessor'
2015-01-23 10:53:20.598 DEBUG --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'inSA'
2015-01-23 10:53:20.598 DEBUG --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'errorMgr'
2015-01-23 10:53:20.598 DEBUG --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean '_org.springframework.integration.errorLogger'
2015-01-23 10:53:20.598 DEBUG --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'lifecycleProcessor'
2015-01-23 10:53:20.599 INFO --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase -2147483648
2015-01-23 10:53:20.600 DEBUG --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting bean 'globalChannelInterceptorProcessor' of type [class org.springframework.integration.config.GlobalChannelInterceptorProcessor]
2015-01-23 10:53:20.602 DEBUG --- [ main] .s.i.c.GlobalChannelInterceptorProcessor : No global channel interceptors.
2015-01-23 10:53:20.603 DEBUG --- [ main] o.s.c.support.DefaultLifecycleProcessor : Successfully started bean 'globalChannelInterceptorProcessor'
2015-01-23 10:53:20.604 INFO --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 0
2015-01-23 10:53:20.605 DEBUG --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting bean 'inSA' of type [class org.springframework.integration.config.ConsumerEndpointFactoryBean]
2015-01-23 10:53:20.605 INFO --- [ main] o.s.i.endpoint.EventDrivenConsumer : Adding {service-activator:inSA} as a subscriber to the 'in' channel
2015-01-23 10:53:20.606 INFO --- [ main] o.s.integration.channel.DirectChannel : Channel 'org.springframework.context.support.GenericApplicationContext#6f3b5d16.in' has 1 subscriber(s).
2015-01-23 10:53:20.606 INFO --- [ main] o.s.i.endpoint.EventDrivenConsumer : started inSA
2015-01-23 10:53:20.606 DEBUG --- [ main] o.s.c.support.DefaultLifecycleProcessor : Successfully started bean 'inSA'
2015-01-23 10:53:20.606 DEBUG --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting bean 'errorMgr' of type [class org.springframework.integration.config.ConsumerEndpointFactoryBean]
2015-01-23 10:53:20.607 INFO --- [ main] o.s.i.endpoint.EventDrivenConsumer : Adding {service-activator:errorMgr} as a subscriber to the 'errorChannel' channel
2015-01-23 10:53:20.607 INFO --- [ main] o.s.i.channel.PublishSubscribeChannel : Channel 'org.springframework.context.support.GenericApplicationContext#6f3b5d16.errorChannel' has 1 subscriber(s).
2015-01-23 10:53:20.607 INFO --- [ main] o.s.i.endpoint.EventDrivenConsumer : started errorMgr
2015-01-23 10:53:20.607 DEBUG --- [ main] o.s.c.support.DefaultLifecycleProcessor : Successfully started bean 'errorMgr'
2015-01-23 10:53:20.607 DEBUG --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting bean '_org.springframework.integration.errorLogger' of type [class org.springframework.integration.config.ConsumerEndpointFactoryBean]
2015-01-23 10:53:20.607 INFO --- [ main] o.s.i.endpoint.EventDrivenConsumer : Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2015-01-23 10:53:20.607 INFO --- [ main] o.s.i.channel.PublishSubscribeChannel : Channel 'org.springframework.context.support.GenericApplicationContext#6f3b5d16.errorChannel' has 2 subscriber(s).
2015-01-23 10:53:20.607 INFO --- [ main] o.s.i.endpoint.EventDrivenConsumer : started _org.springframework.integration.errorLogger
2015-01-23 10:53:20.608 DEBUG --- [ main] o.s.c.support.DefaultLifecycleProcessor : Successfully started bean '_org.springframework.integration.errorLogger'
2015-01-23 10:53:20.610 DEBUG --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'org.springframework.integration.config.IdGeneratorConfigurer#0'
2015-01-23 10:53:20.612 DEBUG --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Searching for key 'spring.liveBeansView.mbeanDomain' in [systemProperties]
2015-01-23 10:53:20.612 DEBUG --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Searching for key 'spring.liveBeansView.mbeanDomain' in [systemEnvironment]
2015-01-23 10:53:20.613 DEBUG --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Could not find key 'spring.liveBeansView.mbeanDomain' in any property source. Returning [null]
2015-01-23 10:53:20.614 DEBUG --- [ main] c.DefaultCacheAwareContextLoaderDelegate : Storing ApplicationContext in cache under key [[MergedContextConfiguration#105fece7 testClass = ErrorHandlerTests, locations = '{classpath:com/att/datalake/ifr/loader/flowtests/ErrorHandlerTests-context.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]
2015-01-23 10:53:20.615 DEBUG --- [ main] org.springframework.test.context.cache : Spring test ApplicationContext cache statistics: [ContextCache#7a1a14a4 size = 1, hitCount = 0, missCount = 1, parentContextCount = 0]
2015-01-23 10:53:20.620 DEBUG --- [ main] o.s.b.f.annotation.InjectionMetadata : Processing injected method of bean 'com.att.datalake.ifr.loader.flowtests.ErrorHandlerTests': AutowiredFieldElement for private org.springframework.messaging.MessageChannel com.att.datalake.ifr.loader.flowtests.ErrorHandlerTests.in
2015-01-23 10:53:20.623 DEBUG --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'in'
2015-01-23 10:53:20.623 DEBUG --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'nullChannel'
2015-01-23 10:53:20.624 DEBUG --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'errorChannel'
2015-01-23 10:53:20.625 DEBUG --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : Autowiring by type from bean name 'com.att.datalake.ifr.loader.flowtests.ErrorHandlerTests' to bean named 'in'
2015-01-23 10:53:20.642 DEBUG --- [ main] o.s.i.handler.ServiceActivatingHandler : ServiceActivator for [org.springframework.integration.handler.MethodInvokingMessageProcessor#49ff7d8c] (inSA) received message: GenericMessage [payload=FileMessage [name=2.txt, path=input/2.txt], headers={ERROR_TYPE=PublisherError, correlationId=1, id=dd662ff5-9790-77e2-cceb-f43afc97de81, timestamp=1422028400642}]
In the Thrower SA at:Fri Jan 23 10:53:20 EST 2015
*****About to throw
2015-01-23 10:53:20.648 DEBUG --- [ main] .c.s.DirtiesContextTestExecutionListener : After test method: context [DefaultTestContext#40e6dfe1 testClass = ErrorHandlerTests, testInstance = com.att.datalake.ifr.loader.flowtests.ErrorHandlerTests#1b083826, testMethod = test#ErrorHandlerTests, testException = org.springframework.messaging.MessageHandlingException: ; nested exception is com.att.datalake.ifr.loader.exceptions.PublisherException: Simple Publisher Exception at:Fri Jan 23 10:53:20 EST 2015, mergedContextConfiguration = [MergedContextConfiguration#105fece7 testClass = ErrorHandlerTests, locations = '{classpath:com/att/datalake/ifr/loader/flowtests/ErrorHandlerTests-context.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]], class dirties context [false], class mode [null], method dirties context [false].
2015-01-23 10:53:20.657 DEBUG --- [ main] .c.s.DirtiesContextTestExecutionListener : After test class: context [DefaultTestContext#40e6dfe1 testClass = ErrorHandlerTests, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration#105fece7 testClass = ErrorHandlerTests, locations = '{classpath:com/att/datalake/ifr/loader/flowtests/ErrorHandlerTests-context.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]], dirtiesContext [false].
2015-01-23 10:53:20.662 INFO --- [ Thread-0] o.s.c.support.GenericApplicationContext : Closing org.springframework.context.support.GenericApplicationContext#6f3b5d16: startup date [Fri Jan 23 10:53:19 EST 2015]; root of context hierarchy
2015-01-23 10:53:20.663 DEBUG --- [ Thread-0] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'org.springframework.integration.config.IdGeneratorConfigurer#0'
2015-01-23 10:53:20.664 DEBUG --- [ Thread-0] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'integrationHeaderChannelRegistry'
2015-01-23 10:53:20.664 DEBUG --- [ Thread-0] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'globalChannelInterceptorProcessor'
2015-01-23 10:53:20.664 DEBUG --- [ Thread-0] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'inSA'
2015-01-23 10:53:20.664 DEBUG --- [ Thread-0] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'errorMgr'
2015-01-23 10:53:20.664 DEBUG --- [ Thread-0] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean '_org.springframework.integration.errorLogger'
2015-01-23 10:53:20.665 DEBUG --- [ Thread-0] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'lifecycleProcessor'
2015-01-23 10:53:20.665 INFO --- [ Thread-0] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0
2015-01-23 10:53:20.666 DEBUG --- [ Thread-0] o.s.c.support.DefaultLifecycleProcessor : Asking bean 'inSA' of type [class org.springframework.integration.config.ConsumerEndpointFactoryBean] to stop
2015-01-23 10:53:20.667 INFO --- [ Thread-0] o.s.i.endpoint.EventDrivenConsumer : Removing {service-activator:inSA} as a subscriber to the 'in' channel
2015-01-23 10:53:20.667 INFO --- [ Thread-0] o.s.integration.channel.DirectChannel : Channel 'org.springframework.context.support.GenericApplicationContext#6f3b5d16.in' has 0 subscriber(s).
2015-01-23 10:53:20.667 DEBUG --- [ Thread-0] o.s.c.support.DefaultLifecycleProcessor : Bean 'inSA' completed its stop procedure
2015-01-23 10:53:20.667 INFO --- [ Thread-0] o.s.i.endpoint.EventDrivenConsumer : stopped inSA
2015-01-23 10:53:20.667 DEBUG --- [ Thread-0] o.s.c.support.DefaultLifecycleProcessor : Asking bean 'errorMgr' of type [class org.springframework.integration.config.ConsumerEndpointFactoryBean] to stop
2015-01-23 10:53:20.667 INFO --- [ Thread-0] o.s.i.endpoint.EventDrivenConsumer : Removing {service-activator:errorMgr} as a subscriber to the 'errorChannel' channel
2015-01-23 10:53:20.667 INFO --- [ Thread-0] o.s.i.channel.PublishSubscribeChannel : Channel 'org.springframework.context.support.GenericApplicationContext#6f3b5d16.errorChannel' has 1 subscriber(s).
2015-01-23 10:53:20.668 DEBUG --- [ Thread-0] o.s.c.support.DefaultLifecycleProcessor : Bean 'errorMgr' completed its stop procedure
2015-01-23 10:53:20.668 INFO --- [ Thread-0] o.s.i.endpoint.EventDrivenConsumer : stopped errorMgr
2015-01-23 10:53:20.668 DEBUG --- [ Thread-0] o.s.c.support.DefaultLifecycleProcessor : Asking bean '_org.springframework.integration.errorLogger' of type [class org.springframework.integration.config.ConsumerEndpointFactoryBean] to stop
2015-01-23 10:53:20.668 INFO --- [ Thread-0] o.s.i.endpoint.EventDrivenConsumer : Removing {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2015-01-23 10:53:20.668 INFO --- [ Thread-0] o.s.i.channel.PublishSubscribeChannel : Channel 'org.springframework.context.support.GenericApplicationContext#6f3b5d16.errorChannel' has 0 subscriber(s).
2015-01-23 10:53:20.668 DEBUG --- [ Thread-0] o.s.c.support.DefaultLifecycleProcessor : Bean '_org.springframework.integration.errorLogger' completed its stop procedure
2015-01-23 10:53:20.668 INFO --- [ Thread-0] o.s.i.endpoint.EventDrivenConsumer : stopped _org.springframework.integration.errorLogger
2015-01-23 10:53:20.668 INFO --- [ Thread-0] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase -2147483648
2015-01-23 10:53:20.668 DEBUG --- [ Thread-0] o.s.b.f.s.DefaultListableBeanFactory : Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#25ce9dc4: defining beans [org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,channelInitializer,$autoCreateChannelCandidates,IntegrationConfigurationBeanFactoryPostProcessor,integrationEvaluationContext,org.springframework.integration.expression.IntegrationEvaluationContextAwareBeanPostProcessor#0,integrationGlobalProperties,integrationHeaderChannelRegistry,globalChannelInterceptorProcessor,toStringFriendlyJsonNodeToStringConverter,converterRegistrar,integrationConversionService,DefaultConfiguringBeanFactoryPostProcessor,datatypeChannelMessageConverter,messageBuilderFactory,in,org.springframework.integration.config.ServiceActivatorFactoryBean#0,inSA,thrower,org.springframework.integration.config.ServiceActivatorFactoryBean#1,fixedSubscriberChannelBeanFactoryPostProcessor,errorMgr,errorManager,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor,nullChannel,errorChannel,_org.springframework.integration.errorLogger,taskScheduler,org.springframework.integration.config.IdGeneratorConfigurer#0]; root of factory hierarchy
2015-01-23 10:53:20.694 DEBUG --- [ Thread-0] o.s.b.f.s.DefaultListableBeanFactory : Retrieved dependent beans for bean '(inner bean)#74589991': [_org.springframework.integration.errorLogger]
2015-01-23 10:53:20.696 DEBUG --- [ Thread-0] o.s.b.f.s.DefaultListableBeanFactory : Retrieved dependent beans for bean 'in': [com.att.datalake.ifr.loader.flowtests.ErrorHandlerTests]
2015-01-23 10:53:20.697 DEBUG --- [ Thread-0] o.s.b.f.support.DisposableBeanAdapter : Invoking destroy() on bean with name 'taskScheduler'
2015-01-23 10:53:20.698 INFO --- [ Thread-0] o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService 'taskScheduler'
2015-01-23 10:53:20.699 DEBUG --- [ Thread-0] o.s.b.f.s.DefaultListableBeanFactory : Retrieved dependent beans for bean '(inner bean)#4b213651': [taskScheduler]
The ErrorMessage with an Exception is thrown to the error-channel only if the downstream flow is within the separate Thread. Otherwise the Exception is rethrown to the call. It is thrown to the caller anyway, but shifted to the error-channel, if there is no original caller control from Spring Integration.
See more info here: http://docs.spring.io/spring-integration/docs/latest-ga/reference/html/configuration.html#namespace-errorhandler