So I am running my kafka consumer. Im just curious why my topic is not anymore placed inside the partition assigned. I believe when it shows that it is assigned, it means that I am able to listen to that topic. But now, logs are showing that there are no assigned partition for my topic. Am I still able to successfully listen to the topic or not?
Here are the logs:
Successfully logged in.
2021-10-01 02:43:14.668 INFO 35404 --- [_user#TEST.COM] o.a.k.c.security.kerberos.KerberosLogin : [Principal=kafka_user#TEST.COM]: TGT refresh thread started.
2021-10-01 02:43:14.668 INFO 35404 --- [_user#TEST.COM] o.a.k.c.security.kerberos.KerberosLogin : [Principal=kafka_user#TEST.COM]: TGT valid starting at: Fri Oct 01 02:43:14 CST 2021
2021-10-01 02:43:14.668 INFO 35404 --- [_user#TEST.COM] o.a.k.c.security.kerberos.KerberosLogin : [Principal=kafka_user#TEST.COM]: TGT expires: Fri Oct 01 12:43:14 CST 2021
2021-10-01 02:43:14.668 INFO 35404 --- [_user#TEST.COM] o.a.k.c.security.kerberos.KerberosLogin : [Principal=kafka_user#TEST.COM]: TGT refresh sleeping until: Fri Oct 01 11:06:34 CST 2021
2021-10-01 02:43:14.689 INFO 35404 --- [ main] o.a.kafka.common.utils.AppInfoParser : Kafka version: 2.3.1
2021-10-01 02:43:14.689 INFO 35404 --- [ main] o.a.kafka.common.utils.AppInfoParser : Kafka commitId: 18a913733fb71c01
2021-10-01 02:43:14.690 INFO 35404 --- [ main] o.a.kafka.common.utils.AppInfoParser : Kafka startTimeMs: 1633027394689
2021-10-01 02:43:14.692 INFO 35404 --- [ main] o.a.k.clients.consumer.KafkaConsumer : [Consumer clientId=consumer-2, groupId=my-group-service-dev] Subscribed to topic(s): MY_TOPIC
2021-10-01 02:43:14.695 INFO 35404 --- [ main] o.s.s.c.ThreadPoolTaskScheduler : Initializing ExecutorService
2021-10-01 02:43:14.706 INFO 35404 --- [ main] s.i.k.i.KafkaMessageDrivenChannelAdapter : started org.springframework.integration.kafka.inbound.KafkaMessageDrivenChannelAdapter#6ad2c882
2021-10-01 02:43:14.712 INFO 35404 --- [ main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
2021-10-01 02:43:14.751 INFO 35404 --- [ main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
2021-10-01 02:43:14.843 INFO 35404 --- [ main] s.d.s.w.s.ApiListingReferenceScanner : Scanning for api listing references
2021-10-01 02:43:15.646 INFO 35404 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8090 (http) with context path ''
2021-10-01 02:43:15.648 INFO 35404 --- [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 8090
2021-10-01 02:43:17.051 WARN 35404 --- [container-0-C-1] org.apache.kafka.clients.NetworkClient : [Consumer clientId=consumer-2, groupId=my-group-service-dev] Connection to node -3 (broker.port3.com/10.235.27.73:6667) could not be established. Broker may not be available.
2021-10-01 02:43:17.388 INFO 35404 --- [ main] com.ap.Application : Started Application in 62.57 seconds (JVM running for 143.114)
2021-10-01 02:43:17.816 INFO 35404 --- [container-0-C-1] org.apache.kafka.clients.Metadata : [Consumer clientId=consumer-2, groupId=my-group-service-dev] Cluster ID: qa_IFa70SgeMIT5JIcDhHA
2021-10-01 02:43:18.213 INFO 35404 --- [container-0-C-1] o.a.k.c.c.internals.AbstractCoordinator : [Consumer clientId=consumer-2, groupId=my-group-service-dev] Discovered group coordinator broker.port1.com:6667 (id: 2147482644 rack: null)
2021-10-01 02:43:18.219 INFO 35404 --- [container-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator : [Consumer clientId=consumer-2, groupId=my-group-service-dev] Revoking previously assigned partitions []
2021-10-01 02:43:18.220 INFO 35404 --- [container-0-C-1] o.s.c.s.b.k.KafkaMessageChannelBinder$1 : my-group-service-dev: partitions revoked: []
2021-10-01 02:43:18.220 INFO 35404 --- [container-0-C-1] o.a.k.c.c.internals.AbstractCoordinator : [Consumer clientId=consumer-2, groupId=my-group-service-dev] (Re-)joining group
2021-10-01 02:43:18.621 INFO 35404 --- [container-0-C-1] o.a.k.c.c.internals.AbstractCoordinator : [Consumer clientId=consumer-2, groupId=my-group-service-dev] (Re-)joining group
2021-10-01 02:43:19.816 INFO 35404 --- [container-0-C-1] o.a.k.c.c.internals.AbstractCoordinator : [Consumer clientId=consumer-2, groupId=my-group-service-dev] Successfully joined group with generation 68
2021-10-01 02:43:19.819 INFO 35404 --- [container-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator : [Consumer clientId=consumer-2, groupId=my-group-service-dev] Setting newly assigned partitions:
2021-10-01 02:43:19.821 INFO 35404 --- [container-0-C-1] o.s.c.s.b.k.KafkaMessageChannelBinder$1 : my-group-service-dev: partitions assigned: []
Related
I am trying to use Hazelcast in a Spring Boot application on my local. But it seems that each instance is starting up separately(without any errors) and not joining into the existing member list.
Instance 1:
Members {size:1, ver:1} [
Member [10.111.130.204]:5701 - 6d4a2864-5c90-4063-a2cc-deb64a950622 this
]
Instance 2:
Members {size:1, ver:1} [
Member [10.111.130.204]:5702 - 196c9d1f-7fd4-4c48-8dec-0fb913671610 this
]
I followed the guideline found here to setup a simple environment https://guides.hazelcast.org/hazelcast-embedded-springboot/
Can someone help figure out what am I missing here?
PS:
I also tried creating below configs, still the same behaviour.
#Bean
public Config hazelCastConfig() {
Config config = new Config();
config.getNetworkConfig().setPortAutoIncrement(true);
config.getGroupConfig().setName("hazelcast-cluster");
config.setManagementCenterConfig(new ManagementCenterConfig().setEnabled(true).setUrl("http://localhost:8080/hazelcast-mancenter"));
NetworkConfig network = config.getNetworkConfig();
JoinConfig join = network.getJoin();
join.getMulticastConfig().setEnabled(true);
return config;
}
#Bean
public HazelcastInstance hazelcastInstance(Config hazelCastConfig) {
return Hazelcast.newHazelcastInstance(hazelCastConfig);
}
Sample Logs[Instance 1]
2021-12-15 18:08:06.186 INFO 38768 --- [ main] com.example.hzdemo.HzDemoApplication : Starting HzDemoApplication
2021-12-15 18:08:06.192 INFO 38768 --- [ main] com.example.hzdemo.HzDemoApplication : No active profile set, falling back to default profiles: default
2021-12-15 18:08:07.776 INFO 38768 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http)
2021-12-15 18:08:07.783 INFO 38768 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-12-15 18:08:07.783 INFO 38768 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.55]
2021-12-15 18:08:07.854 INFO 38768 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-12-15 18:08:07.854 INFO 38768 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1542 ms
2021-12-15 18:08:07.943 WARN 38768 --- [ main] c.h.instance.HazelcastInstanceFactory : Hazelcast is starting in a Java modular environment (Java 9 and newer) but without proper access to required Java packages. Use additional Java arguments to provide Hazelcast access to Java internal API. The internal API access is used to get the best performance results. Arguments to be used:
--add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED
2021-12-15 18:08:07.966 INFO 38768 --- [ main] com.hazelcast.instance.AddressPicker : [LOCAL] [hazelcast-cluster] [3.12.6] Prefer IPv4 stack is true, prefer IPv6 addresses is false
2021-12-15 18:08:07.985 INFO 38768 --- [ main] com.hazelcast.instance.AddressPicker : [LOCAL] [hazelcast-cluster] [3.12.6] Picked [10.111.130.204]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true
2021-12-15 18:08:07.994 INFO 38768 --- [ main] com.hazelcast.system : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Hazelcast 3.12.6 (20200130 - be02cc5) starting at [10.111.130.204]:5701
2021-12-15 18:08:07.994 INFO 38768 --- [ main] com.hazelcast.system : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Copyright (c) 2008-2020, Hazelcast, Inc. All Rights Reserved.
2021-12-15 18:08:08.208 INFO 38768 --- [ main] c.h.s.i.o.impl.BackpressureRegulator : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Backpressure is disabled
2021-12-15 18:08:08.576 INFO 38768 --- [ main] com.hazelcast.instance.Node : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Creating MulticastJoiner
2021-12-15 18:08:08.676 INFO 38768 --- [ main] c.h.s.i.o.impl.OperationExecutorImpl : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Starting 16 partition threads and 9 generic threads (1 dedicated for priority tasks)
2021-12-15 18:08:08.678 INFO 38768 --- [ main] c.h.internal.diagnostics.Diagnostics : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Diagnostics disabled. To enable add -Dhazelcast.diagnostics.enabled=true to the JVM arguments.
2021-12-15 18:08:08.686 INFO 38768 --- [ main] com.hazelcast.core.LifecycleService : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] [10.111.130.204]:5701 is STARTING
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.hazelcast.internal.networking.nio.SelectorOptimizer (file:/Users/<user>/.gradle/caches/modules-2/files-2.1/com.hazelcast/hazelcast/3.12.6/7640af720dfb86de81d93617271e2959dea6bfdc/hazelcast-3.12.6.jar) to field sun.nio.ch.SelectorImpl.selectedKeys
WARNING: Please consider reporting this to the maintainers of com.hazelcast.internal.networking.nio.SelectorOptimizer
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2021-12-15 18:08:11.096 INFO 38768 --- [ main] c.h.internal.cluster.ClusterService : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6]
Members {size:1, ver:1} [
Member [10.111.130.204]:5701 - 6d4a2864-5c90-4063-a2cc-deb64a950622 this
]
2021-12-15 18:08:11.111 INFO 38768 --- [ main] c.h.i.m.ManagementCenterService : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Hazelcast will connect to Hazelcast Management Center on address:
http://localhost:8080/hazelcast-mancenter
2021-12-15 18:08:11.117 INFO 38768 --- [ main] com.hazelcast.core.LifecycleService : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] [10.111.130.204]:5701 is STARTED
2021-12-15 18:08:11.389 INFO 38768 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path ''
2021-12-15 18:08:11.404 INFO 38768 --- [ main] com.example.hzdemo.HzDemoApplication : Started HzDemoApplication in 5.715 seconds (JVM running for 6.731)
2021-12-15 18:08:12.126 INFO 38768 --- [.MC.Task.Poller] c.h.i.m.ManagementCenterService : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Failed to pull tasks from Management Center
2021-12-15 18:08:12.126 INFO 38768 --- [MC.State.Sender] c.h.i.m.ManagementCenterService : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Failed to connect to: http://localhost:8080/hazelcast-mancenter/collector.do
2021-12-15 18:08:12.126 INFO 38768 --- [MC.State.Sender] com.hazelcast.client.impl.ClientEngine : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Applying a new client selector :ClientSelector{any}
Sample Logs[Instance 2]
2021-12-15 18:09:06.831 INFO 39059 --- [ main] com.example.hzdemo.HzDemoApplication : Starting HzDemoApplication
2021-12-15 18:09:06.843 INFO 39059 --- [ main] com.example.hzdemo.HzDemoApplication : No active profile set, falling back to default profiles: default
2021-12-15 18:09:07.943 INFO 39059 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8082 (http)
2021-12-15 18:09:07.953 INFO 39059 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-12-15 18:09:07.954 INFO 39059 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.31]
2021-12-15 18:09:08.024 INFO 39059 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-12-15 18:09:08.024 INFO 39059 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1047 ms
2021-12-15 18:09:08.162 INFO 39059 --- [ main] com.hazelcast.instance.AddressPicker : [LOCAL] [hazelcast-cluster] [3.12.6] Prefer IPv4 stack is true, prefer IPv6 addresses is false
2021-12-15 18:09:08.188 INFO 39059 --- [ main] com.hazelcast.instance.AddressPicker : [LOCAL] [hazelcast-cluster] [3.12.6] Picked [10.111.130.204]:5702, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5702], bind any local is true
2021-12-15 18:09:08.213 INFO 39059 --- [ main] com.hazelcast.system : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Hazelcast 3.12.6 (20200130 - be02cc5) starting at [10.111.130.204]:5702
2021-12-15 18:09:08.213 INFO 39059 --- [ main] com.hazelcast.system : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Copyright (c) 2008-2020, Hazelcast, Inc. All Rights Reserved.
2021-12-15 18:09:08.490 INFO 39059 --- [ main] c.h.s.i.o.impl.BackpressureRegulator : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Backpressure is disabled
2021-12-15 18:09:08.917 INFO 39059 --- [ main] com.hazelcast.instance.Node : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Creating MulticastJoiner
2021-12-15 18:09:09.101 INFO 39059 --- [ main] c.h.s.i.o.impl.OperationExecutorImpl : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Starting 16 partition threads and 9 generic threads (1 dedicated for priority tasks)
2021-12-15 18:09:09.104 INFO 39059 --- [ main] c.h.internal.diagnostics.Diagnostics : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Diagnostics disabled. To enable add -Dhazelcast.diagnostics.enabled=true to the JVM arguments.
2021-12-15 18:09:09.107 INFO 39059 --- [ main] com.hazelcast.core.LifecycleService : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] [10.111.130.204]:5702 is STARTING
2021-12-15 18:09:11.423 INFO 39059 --- [ main] c.h.internal.cluster.ClusterService : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6]
Members {size:1, ver:1} [
Member [10.111.130.204]:5702 - 196c9d1f-7fd4-4c48-8dec-0fb913671610 this
]
2021-12-15 18:09:11.424 WARN 39059 --- [ main] com.hazelcast.instance.Node : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Config seed port is 5701 and cluster size is 1. Some of the ports seem occupied!
2021-12-15 18:09:11.451 INFO 39059 --- [ main] c.h.i.m.ManagementCenterService : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Hazelcast will connect to Hazelcast Management Center on address:
http://localhost:8080/hazelcast-mancenter
2021-12-15 18:09:11.460 INFO 39059 --- [ main] com.hazelcast.core.LifecycleService : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] [10.111.130.204]:5702 is STARTED
2021-12-15 18:09:11.620 INFO 39059 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-12-15 18:09:11.761 INFO 39059 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8082 (http) with context path ''
2021-12-15 18:09:11.765 INFO 39059 --- [ main] com.example.hzdemo.HzDemoApplication : Started HzDemoApplication in 5.854 seconds (JVM running for 6.337)
2021-12-15 18:09:12.470 INFO 39059 --- [.MC.Task.Poller] c.h.i.m.ManagementCenterService : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Failed to pull tasks from Management Center
2021-12-15 18:09:12.470 INFO 39059 --- [MC.State.Sender] c.h.i.m.ManagementCenterService : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Failed to connect to: http://localhost:8080/hazelcast-mancenter/collector.do
2021-12-15 18:09:12.471 INFO 39059 --- [MC.State.Sender] com.hazelcast.client.impl.ClientEngine : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Applying a new client selector :ClientSelector{any}
ifconfig output:
utun2: flags=80d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1390
inet 10.111.130.204 --> 10.111.130.204 netmask 0xffffc000
I have created a Bootstrap project in which I have 3 repositories. When I compile the project I do not receive any errors but unfortunately I can not see my controllers in Swagger!!!
I have found out that line 4 says:
Finished Spring Data repository scanning in 4 ms. Found 0 JPA
repository interfaces.
I think this the reason that I can not see the controllers. Any idea to solve this? Thank you in advance.
2021-12-14 00:26:13.768 INFO 5472 --- [ main] WBSthesis.rotab.RotabApplication
: No active profile set, falling back to default profiles: default
2021-12-14 00:26:14.648 INFO 5472 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-12-14 00:26:14.661 INFO 5472 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : ***Finished Spring Data repository scanning in 4 ms. Found 0 JPA repository interfaces.***
2021-12-14 00:26:15.592 INFO 5472 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2021-12-14 00:26:15.609 INFO 5472 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-12-14 00:26:15.609 INFO 5472 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.54]
2021-12-14 00:26:15.718 INFO 5472 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-12-14 00:26:15.718 INFO 5472 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1885 ms
2021-12-14 00:26:15.975 INFO 5472 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-12-14 00:26:16.051 INFO 5472 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.32.Final
2021-12-14 00:26:16.226 INFO 5472 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-12-14 00:26:16.356 INFO 5472 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-12-14 00:26:16.562 INFO 5472 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-12-14 00:26:16.580 INFO 5472 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL55Dialect
2021-12-14 00:26:16.856 INFO 5472 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-12-14 00:26:16.866 INFO 5472 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-12-14 00:26:17.090 WARN 5472 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2021-12-14 00:26:17.225 INFO 5472 --- [ main] pertySourcedRequestMappingHandlerMapping : Mapped URL path [/v2/api-docs] onto method [springfox.documentation.swagger2.web.Swagger2Controller#getDocumentation(String, HttpServletRequest)]
2021-12-14 00:26:17.490 INFO 5472 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2021-12-14 00:26:17.491 INFO 5472 --- [ main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
2021-12-14 00:26:17.511 INFO 5472 --- [ main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
2021-12-14 00:26:17.544 INFO 5472 --- [ main] s.d.s.w.s.ApiListingReferenceScanner : Scanning for api listing references
2021-12-14 00:26:17.698 INFO 5472 --- [ main] WBSthesis.rotab.RotabApplication : Started RotabApplication in 4.468 seconds (JVM running for 4.958)
More info of your project would be helpful, but maybe your interfaces are not inside the right package. I was facing this once...
Here is an example.
Notice that all sub-packages are on the same level as the #SpringBootApplication.
I am writing a UDP syslog message receiver in Spring Boot 1.5.6.RELEASE and it shuts down if I don't add spring-boot-starter-web dependency. The thing is I don't need web dependency because the application only receives, filters and sends the log further via TCP. I'm using org.springframework.integration.syslog.inbound.UdpSyslogReceivingChannelAdapter.
Receiver:
#Bean
public UdpSyslogReceivingChannelAdapter udpReceiver() {
final UdpSyslogReceivingChannelAdapter adapter = new UdpSyslogReceivingChannelAdapter();
adapter.setPort(properties.getUdp().getLocalPort());
adapter.setOutputChannelName("routingChannel");
adapter.setConverter(converter);
return adapter;
}
This is the console output and it shows no exceptions:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.6.RELEASE)
2018-10-05 08:55:18.338 INFO 21016 --- [ main] h.b.iptv.stream.IptvStreamApplication : Starting IptvStreamApplication on DESKTOP-0S65L7N with PID 21016 (D:\Projects\iptv\iptv-stream\target\classes started by tomiv in D:\Projects\iptv)
2018-10-05 08:55:18.342 INFO 21016 --- [ main] h.b.iptv.stream.IptvStreamApplication : No active profile set, falling back to default profiles: default
2018-10-05 08:55:18.386 INFO 21016 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext#384ad17b: startup date [Fri Oct 05 08:55:18 CEST 2018]; root of context hierarchy
2018-10-05 08:55:19.325 INFO 21016 --- [ main] o.s.i.config.IntegrationRegistrar : No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
2018-10-05 08:55:19.400 INFO 21016 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2018-10-05 08:55:19.546 INFO 21016 --- [ main] faultConfiguringBeanFactoryPostProcessor : No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
2018-10-05 08:55:19.552 INFO 21016 --- [ main] faultConfiguringBeanFactoryPostProcessor : No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created.
2018-10-05 08:55:19.674 INFO 21016 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'integrationGlobalProperties' of type [org.springframework.beans.factory.config.PropertiesFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-10-05 08:55:19.678 INFO 21016 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'integrationGlobalProperties' of type [java.util.Properties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-10-05 08:55:19.986 INFO 21016 --- [ main] o.s.s.c.ThreadPoolTaskScheduler : Initializing ExecutorService 'taskScheduler'
2018-10-05 08:55:20.064 INFO 21016 --- [ main] redis.clients.jedis.JedisSentinelPool : Trying to find master from available Sentinels...
2018-10-05 08:55:20.082 INFO 21016 --- [ main] redis.clients.jedis.JedisSentinelPool : Redis master running at 10.10.20.49:6379, starting Sentinel listeners...
2018-10-05 08:55:20.091 INFO 21016 --- [ main] redis.clients.jedis.JedisSentinelPool : Created JedisPool to master at 10.10.20.49:6379
2018-10-05 08:55:20.093 INFO 21016 --- [ main] redis.clients.jedis.JedisSentinelPool : Trying to find master from available Sentinels...
2018-10-05 08:55:20.096 INFO 21016 --- [ main] redis.clients.jedis.JedisSentinelPool : Redis master running at 10.10.20.49:6379, starting Sentinel listeners...
2018-10-05 08:55:20.097 INFO 21016 --- [ main] redis.clients.jedis.JedisSentinelPool : Created JedisPool to master at 10.10.20.49:6379
2018-10-05 08:55:20.097 INFO 21016 --- [ main] redis.clients.jedis.JedisSentinelPool : Trying to find master from available Sentinels...
2018-10-05 08:55:20.099 INFO 21016 --- [ main] redis.clients.jedis.JedisSentinelPool : Redis master running at 10.10.20.49:6379, starting Sentinel listeners...
2018-10-05 08:55:20.100 INFO 21016 --- [ main] redis.clients.jedis.JedisSentinelPool : Created JedisPool to master at 10.10.20.49:6379
2018-10-05 08:55:20.400 INFO 21016 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-10-05 08:55:20.405 INFO 21016 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'payloadHandlingService.route.router.handler' has been autodetected for JMX exposure
2018-10-05 08:55:20.406 INFO 21016 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'payloadHandlingService.route.router.handler': registering with JMX server as MBean [org.springframework.integration.router:name=payloadHandlingService.route.router.handler,type=MethodInvokingRouter]
2018-10-05 08:55:20.460 INFO 21016 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase -2147483648
2018-10-05 08:55:20.460 INFO 21016 --- [ main] o.s.i.endpoint.EventDrivenConsumer : Adding {message-handler:streamConfiguration.handler.serviceActivator} as a subscriber to the 'udpOut' channel
2018-10-05 08:55:20.460 INFO 21016 --- [ main] o.s.integration.channel.DirectChannel : Channel 'application.udpOut' has 1 subscriber(s).
2018-10-05 08:55:20.460 INFO 21016 --- [ main] o.s.i.endpoint.EventDrivenConsumer : started streamConfiguration.handler.serviceActivator
2018-10-05 08:55:20.460 INFO 21016 --- [ main] o.s.i.endpoint.EventDrivenConsumer : Adding {message-handler:streamConfiguration.tcpSender.serviceActivator} as a subscriber to the 'tcpOut' channel
2018-10-05 08:55:20.460 INFO 21016 --- [ main] o.s.integration.channel.DirectChannel : Channel 'application.tcpOut' has 1 subscriber(s).
2018-10-05 08:55:20.460 INFO 21016 --- [ main] .s.i.i.t.c.TcpNetClientConnectionFactory : started tcpConnectionFactory, host=localhost, port=3333
2018-10-05 08:55:20.460 INFO 21016 --- [ main] o.s.i.endpoint.EventDrivenConsumer : started streamConfiguration.tcpSender.serviceActivator
2018-10-05 08:55:20.460 INFO 21016 --- [ main] o.s.i.endpoint.EventDrivenConsumer : Adding {router:payloadHandlingService.route.router} as a subscriber to the 'routingChannel' channel
2018-10-05 08:55:20.460 INFO 21016 --- [ main] o.s.integration.channel.DirectChannel : Channel 'application.routingChannel' has 1 subscriber(s).
2018-10-05 08:55:20.460 INFO 21016 --- [ main] o.s.i.endpoint.EventDrivenConsumer : started payloadHandlingService.route.router
2018-10-05 08:55:20.460 INFO 21016 --- [ main] o.s.i.endpoint.EventDrivenConsumer : Adding {service-activator:payloadHandlingService.handleAvrPayload.serviceActivator} as a subscriber to the 'anonymizationChannel' channel
2018-10-05 08:55:20.461 INFO 21016 --- [ main] o.s.integration.channel.DirectChannel : Channel 'application.anonymizationChannel' has 1 subscriber(s).
2018-10-05 08:55:20.461 INFO 21016 --- [ main] o.s.i.endpoint.EventDrivenConsumer : started payloadHandlingService.handleAvrPayload.serviceActivator
2018-10-05 08:55:20.461 INFO 21016 --- [ main] o.s.i.endpoint.EventDrivenConsumer : Adding {service-activator:payloadHandlingService.handleUdpProbePayload.serviceActivator} as a subscriber to the 'loadBalancerChannel' channel
2018-10-05 08:55:20.461 INFO 21016 --- [ main] o.s.integration.channel.DirectChannel : Channel 'application.loadBalancerChannel' has 1 subscriber(s).
2018-10-05 08:55:20.461 INFO 21016 --- [ main] o.s.i.endpoint.EventDrivenConsumer : started payloadHandlingService.handleUdpProbePayload.serviceActivator
2018-10-05 08:55:20.463 INFO 21016 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 0
2018-10-05 08:55:20.463 INFO 21016 --- [ main] o.s.i.endpoint.EventDrivenConsumer : Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2018-10-05 08:55:20.463 INFO 21016 --- [ main] o.s.i.channel.PublishSubscribeChannel : Channel 'application.errorChannel' has 1 subscriber(s).
2018-10-05 08:55:20.463 INFO 21016 --- [ main] o.s.i.endpoint.EventDrivenConsumer : started _org.springframework.integration.errorLogger
2018-10-05 08:55:20.463 INFO 21016 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 1073741823
2018-10-05 08:55:20.464 INFO 21016 --- [ main] o.s.i.i.u.UnicastReceivingChannelAdapter : started org.springframework.integration.ip.udp.UnicastReceivingChannelAdapter#70887727
2018-10-05 08:55:20.464 INFO 21016 --- [ main] s.i.s.i.UdpSyslogReceivingChannelAdapter : started udpReceiver
2018-10-05 08:55:20.471 INFO 21016 --- [ main] h.b.iptv.stream.IptvStreamApplication : Started IptvStreamApplication in 2.421 seconds (JVM running for 3.548)
2018-10-05 08:55:20.472 INFO 21016 --- [ Thread-10] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext#384ad17b: startup date [Fri Oct 05 08:55:18 CEST 2018]; root of context hierarchy
2018-10-05 08:55:20.473 INFO 21016 --- [ Thread-10] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 1073741823
2018-10-05 08:55:20.474 INFO 21016 --- [ Thread-10] o.s.i.i.u.UnicastReceivingChannelAdapter : stopped org.springframework.integration.ip.udp.UnicastReceivingChannelAdapter#70887727
2018-10-05 08:55:20.474 INFO 21016 --- [ Thread-10] s.i.s.i.UdpSyslogReceivingChannelAdapter : stopped udpReceiver
2018-10-05 08:55:20.474 INFO 21016 --- [ Thread-10] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0
2018-10-05 08:55:20.474 INFO 21016 --- [ Thread-10] .s.i.i.t.c.TcpNetClientConnectionFactory : stopped tcpConnectionFactory, host=localhost, port=3333
2018-10-05 08:55:20.474 INFO 21016 --- [ Thread-10] o.s.i.endpoint.EventDrivenConsumer : Removing {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2018-10-05 08:55:20.474 INFO 21016 --- [ Thread-10] o.s.i.channel.PublishSubscribeChannel : Channel 'application.errorChannel' has 0 subscriber(s).
2018-10-05 08:55:20.474 INFO 21016 --- [ Thread-10] o.s.i.endpoint.EventDrivenConsumer : stopped _org.springframework.integration.errorLogger
2018-10-05 08:55:20.474 INFO 21016 --- [ Thread-10] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase -2147483648
2018-10-05 08:55:20.474 INFO 21016 --- [ Thread-10] o.s.i.endpoint.EventDrivenConsumer : Removing {message-handler:streamConfiguration.handler.serviceActivator} as a subscriber to the 'udpOut' channel
2018-10-05 08:55:20.474 INFO 21016 --- [ Thread-10] o.s.integration.channel.DirectChannel : Channel 'application.udpOut' has 0 subscriber(s).
2018-10-05 08:55:20.474 INFO 21016 --- [ Thread-10] o.s.i.endpoint.EventDrivenConsumer : stopped streamConfiguration.handler.serviceActivator
2018-10-05 08:55:20.474 INFO 21016 --- [ Thread-10] o.s.i.endpoint.EventDrivenConsumer : Removing {message-handler:streamConfiguration.tcpSender.serviceActivator} as a subscriber to the 'tcpOut' channel
2018-10-05 08:55:20.475 INFO 21016 --- [ Thread-10] o.s.integration.channel.DirectChannel : Channel 'application.tcpOut' has 0 subscriber(s).
2018-10-05 08:55:20.475 INFO 21016 --- [ Thread-10] o.s.i.endpoint.EventDrivenConsumer : stopped streamConfiguration.tcpSender.serviceActivator
2018-10-05 08:55:20.475 INFO 21016 --- [ Thread-10] o.s.i.endpoint.EventDrivenConsumer : Removing {router:payloadHandlingService.route.router} as a subscriber to the 'routingChannel' channel
2018-10-05 08:55:20.475 INFO 21016 --- [ Thread-10] o.s.integration.channel.DirectChannel : Channel 'application.routingChannel' has 0 subscriber(s).
2018-10-05 08:55:20.475 INFO 21016 --- [ Thread-10] o.s.i.endpoint.EventDrivenConsumer : stopped payloadHandlingService.route.router
2018-10-05 08:55:20.476 INFO 21016 --- [ Thread-10] o.s.i.endpoint.EventDrivenConsumer : Removing {service-activator:payloadHandlingService.handleAvrPayload.serviceActivator} as a subscriber to the 'anonymizationChannel' channel
2018-10-05 08:55:20.476 INFO 21016 --- [ Thread-10] o.s.integration.channel.DirectChannel : Channel 'application.anonymizationChannel' has 0 subscriber(s).
2018-10-05 08:55:20.476 INFO 21016 --- [ Thread-10] o.s.i.endpoint.EventDrivenConsumer : stopped payloadHandlingService.handleAvrPayload.serviceActivator
2018-10-05 08:55:20.476 INFO 21016 --- [ Thread-10] o.s.i.endpoint.EventDrivenConsumer : Removing {service-activator:payloadHandlingService.handleUdpProbePayload.serviceActivator} as a subscriber to the 'loadBalancerChannel' channel
2018-10-05 08:55:20.476 INFO 21016 --- [ Thread-10] o.s.integration.channel.DirectChannel : Channel 'application.loadBalancerChannel' has 0 subscriber(s).
2018-10-05 08:55:20.476 INFO 21016 --- [ Thread-10] o.s.i.endpoint.EventDrivenConsumer : stopped payloadHandlingService.handleUdpProbePayload.serviceActivator
2018-10-05 08:55:20.476 INFO 21016 --- [ Thread-10] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2018-10-05 08:55:20.476 INFO 21016 --- [ Thread-10] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans
2018-10-05 08:55:20.477 INFO 21016 --- [ Thread-10] o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService 'taskScheduler'
Process finished with exit code 0
While debugging I've tried to use org.springframework.integration.syslog.inbound.TcpSyslogReceivingChannelAdapter and the application doesn't shut down even though the web dependency isn't added. What is the reason for the app to be shutting down while using the org.springframework.integration.syslog.inbound.UdpSyslogReceivingChannelAdapter? Can I use UdpSyslogReceivingChannelAdapter without spring-boot-starter-web dependency?
The underlying UDP adapter uses a daemon thread by default (daemon threads do not prevent JVM exit).
You can provide a different task executor that doesn't use daemon threads...
#Bean
public UdpSyslogReceivingChannelAdapter udpReceiver() {
final UdpSyslogReceivingChannelAdapter adapter = new UdpSyslogReceivingChannelAdapter();
adapter.setUdpAdapter(receiver());
adapter.setOutputChannelName("routingChannel");
adapter.setConverter(converter);
return adapter;
}
#Bean
public UnicastReceivingChannelAdapter receiver() {
UnicastReceivingChannelAdapter adapter = new UnicastReceivingChannelAdapter(properties.getUdp().getLocalPort());
adapter.setTaskExecutor(executor());
return adapter;
}
#Bean
public TaskExecutor executor() {
ThreadPoolTaskExecutor exec = new ThreadPoolTaskExecutor();
exec.setCorePoolSize(5);
return exec;
}
I'm new to Spring Boot and I bought the book for Spring Boot 2.0 by Greg Turnsquit. In chapter 1 there is a simple application in which if I take a look to http://localhost:8080/chapters URL I'll be able to see the chapter list.
The error I'm having is that on the console the app prints the hashcode of the classes in the repository. In the web browser the app prints a dictionary with three empty elements.
Code Example: https://github.com/learning-spring-boot/learning-spring-boot-2nd-edition-code/tree/master/1
Chapter Controller
package com.greglturnquist.learningspringboot;
import reactor.core.publisher.Flux;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
#RestController
public class ChapterController {
private final ChapterRepository repository;
public ChapterController(ChapterRepository repository) {
this.repository = repository;
}
#GetMapping("/chapters")
public Flux<Chapter> listing() {
return repository.findAll();
}
}
Chapter Repository
package com.greglturnquist.learningspringboot;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
public interface ChapterRepository
extends ReactiveCrudRepository<Chapter, String> {
}
Loading of Database
package com.greglturnquist.learningspringboot;
import reactor.core.publisher.Flux;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
#Configuration
public class LoadDatabase {
#Bean
CommandLineRunner init(ChapterRepository repository) {
return args -> {
Flux.just(
new Chapter("Quick Start with Java"),
new Chapter("Reactive Web with Spring Boot"),
new Chapter("...and more!"))
.flatMap(repository::save)
.subscribe(System.out::println);
};
}
}
Fixes I tried
I know sometimes things can be cached in the web browser. I have killed the services running on the port the application is running in. I've also taken a look into the stack trace and there is no error relating to the app itself other than printing the hash of the Chapter objects and not the object information themselves. I'm assuming it might be related to web-flux. However, I'm unsure how the Chapter Repository interacts with web-flux and the embedded MongoDB.
Thanks in advance for any tips and suggestions.
Console log
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.0.M5)
2018-06-28 11:21:33.581 INFO 1804 --- [ main] c.g.l.LearningSpringBootApplication : Starting LearningSpringBootApplication on ARD-B3LM5R1 with PID 1804 (C:\DevTraining\Learning-Spring-Boot-2.0-Second-Edition\Chapter01\part1\out\production\classes started by nmartinez in C:\DevTraining\Learning-Spring-Boot-2.0-Second-Edition\Chapter01\part1)
2018-06-28 11:21:33.584 DEBUG 1804 --- [ main] c.g.l.LearningSpringBootApplication : Running with Spring Boot v2.0.0.M5, Spring v5.0.0.RELEASE
2018-06-28 11:21:33.585 INFO 1804 --- [ main] c.g.l.LearningSpringBootApplication : No active profile set, falling back to default profiles: default
2018-06-28 11:21:33.680 INFO 1804 --- [ main] .r.c.ReactiveWebServerApplicationContext : Refreshing org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext#5ccddd20: startup date [Thu Jun 28 11:21:33 EDT 2018]; root of context hierarchy
2018-06-28 11:21:34.969 WARN 1804 --- [ main] o.h.v.m.ParameterMessageInterpolator : HV000184: ParameterMessageInterpolator has been chosen, EL interpolation will not be supported
2018-06-28 11:21:35.383 WARN 1804 --- [ main] ion$DefaultTemplateResolverConfiguration : Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)
2018-06-28 11:21:35.575 INFO 1804 --- [ main] s.w.r.r.m.a.RequestMappingHandlerMapping : Mapped "{[/chapters],methods=[GET]}" onto public reactor.core.publisher.Flux<com.greglturnquist.learningspringboot.Chapter> com.greglturnquist.learningspringboot.ChapterController.listing()
2018-06-28 11:21:35.578 INFO 1804 --- [ main] s.w.r.r.m.a.RequestMappingHandlerMapping : Mapped "{[],methods=[GET]}" onto public java.lang.String com.greglturnquist.learningspringboot.HomeController.greeting(java.lang.String)
2018-06-28 11:21:35.664 INFO 1804 --- [ main] o.s.w.r.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.reactive.resource.ResourceWebHandler]
2018-06-28 11:21:35.664 INFO 1804 --- [ main] o.s.w.r.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.reactive.resource.ResourceWebHandler]
2018-06-28 11:21:35.684 WARN 1804 --- [ main] o.h.v.m.ParameterMessageInterpolator : HV000184: ParameterMessageInterpolator has been chosen, EL interpolation will not be supported
2018-06-28 11:21:35.753 INFO 1804 --- [ main] o.s.w.r.r.m.a.ControllerMethodResolver : Looking for #ControllerAdvice: org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext#5ccddd20: startup date [Thu Jun 28 11:21:33 EDT 2018]; root of context hierarchy
2018-06-28 11:21:36.812 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : note: noprealloc may hurt performance in many applications
2018-06-28 11:21:36.813 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.710-0400 I CONTROL [main] Hotfix KB2731284 or later update is not installed, will zero-out data files
2018-06-28 11:21:36.813 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.712-0400 I CONTROL [initandlisten] MongoDB starting : pid=6980 port=51561 dbpath=C:\Users\NMARTI~1\AppData\Local\Temp\embedmongo-db-250ddd2d-2dba-4972-a86e-decdcbe4df3b 64-bit host=ARD-B3LM5R1
2018-06-28 11:21:36.813 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.712-0400 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2018-06-28 11:21:36.813 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.712-0400 I CONTROL [initandlisten] db version v3.2.2
2018-06-28 11:21:36.813 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.712-0400 I CONTROL [initandlisten] git version: 6e71d0d568e134c029203593b00a0103e7cdf30b
2018-06-28 11:21:36.813 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.712-0400 I CONTROL [initandlisten] allocator: tcmalloc
2018-06-28 11:21:36.813 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.712-0400 I CONTROL [initandlisten] modules: none
2018-06-28 11:21:36.813 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.712-0400 I CONTROL [initandlisten] build environment:
2018-06-28 11:21:36.814 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.712-0400 I CONTROL [initandlisten] distmod: 2008plus
2018-06-28 11:21:36.814 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.712-0400 I CONTROL [initandlisten] distarch: x86_64
2018-06-28 11:21:36.814 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.712-0400 I CONTROL [initandlisten] target_arch: x86_64
2018-06-28 11:21:36.814 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.712-0400 I CONTROL [initandlisten] options: { net: { bindIp: "127.0.0.1", http: { enabled: false }, port: 51561 }, security: { authorization: "disabled" }, storage: { dbPath: "C:\Users\NMARTI~1\AppData\Local\Temp\embedmongo-db-250ddd2d-2dba-4972-a86e-decdcbe4df3b", journal: { enabled: false }, mmapv1: { preallocDataFiles: false, smallFiles: true }, syncPeriodSecs: 0.0 } }
2018-06-28 11:21:36.814 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.718-0400 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=4G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=0,log_size=2GB),statistics_log=(wait=0),,log=(enabled=false),
2018-06-28 11:21:36.860 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.859-0400 W STORAGE [initandlisten] Detected configuration for non-active storage engine mmapv1 when current storage engine is wiredTiger
2018-06-28 11:21:36.861 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.861-0400 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2018-06-28 11:21:36.861 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.861-0400 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'C:/Users/NMARTI~1/AppData/Local/Temp/embedmongo-db-250ddd2d-2dba-4972-a86e-decdcbe4df3b/diagnostic.data'
2018-06-28 11:21:36.904 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:36.904-0400 I NETWORK [initandlisten] waiting for connections on port 51561
2018-06-28 11:21:36.904 INFO 1804 --- [ main] d.f.embed.process.runtime.Executable : start de.flapdoodle.embed.mongo.config.MongodConfigBuilder$ImmutableMongodConfig#3f1ddac2
2018-06-28 11:21:37.252 INFO 1804 --- [ main] org.mongodb.driver.cluster : Cluster created with settings {hosts=[localhost:51561], mode=MULTIPLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
2018-06-28 11:21:37.252 INFO 1804 --- [ main] org.mongodb.driver.cluster : Adding discovered server localhost:51561 to client view of cluster
2018-06-28 11:21:37.297 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:37.297-0400 I NETWORK [initandlisten] connection accepted from 127.0.0.1:51563 #1 (1 connection now open)
2018-06-28 11:21:37.323 INFO 1804 --- [localhost:51561] org.mongodb.driver.connection : Opened connection [connectionId{localValue:1, serverValue:1}] to localhost:51561
2018-06-28 11:21:37.326 INFO 1804 --- [localhost:51561] org.mongodb.driver.cluster : Monitor thread successfully connected to server with description ServerDescription{address=localhost:51561, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 2, 2]}, minWireVersion=0, maxWireVersion=4, maxDocumentSize=16777216, roundTripTimeNanos=831762}
2018-06-28 11:21:37.328 INFO 1804 --- [localhost:51561] org.mongodb.driver.cluster : Discovered cluster type of STANDALONE
2018-06-28 11:21:37.731 INFO 1804 --- [ main] org.mongodb.driver.cluster : Cluster created with settings {hosts=[localhost:51561], mode=MULTIPLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
2018-06-28 11:21:37.731 INFO 1804 --- [ main] org.mongodb.driver.cluster : Adding discovered server localhost:51561 to client view of cluster
2018-06-28 11:21:37.734 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:37.734-0400 I NETWORK [initandlisten] connection accepted from 127.0.0.1:51564 #2 (2 connections now open)
2018-06-28 11:21:37.737 INFO 1804 --- [localhost:51561] org.mongodb.driver.connection : Opened connection [connectionId{localValue:2, serverValue:2}] to localhost:51561
2018-06-28 11:21:37.737 INFO 1804 --- [localhost:51561] org.mongodb.driver.cluster : Monitor thread successfully connected to server with description ServerDescription{address=localhost:51561, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 2, 2]}, minWireVersion=0, maxWireVersion=4, maxDocumentSize=16777216, roundTripTimeNanos=336344}
2018-06-28 11:21:37.738 INFO 1804 --- [localhost:51561] org.mongodb.driver.cluster : Discovered cluster type of STANDALONE
2018-06-28 11:21:38.384 INFO 1804 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-06-28 11:21:38.669 INFO 1804 --- [ctor-http-nio-1] r.ipc.netty.tcp.BlockingNettyContext : Started HttpServer on /0:0:0:0:0:0:0:0:9001
2018-06-28 11:21:38.669 INFO 1804 --- [ main] o.s.b.web.embedded.netty.NettyWebServer : Netty started on port(s): 9001
2018-06-28 11:21:38.736 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:38.736-0400 I NETWORK [initandlisten] connection accepted from 127.0.0.1:51565 #3 (3 connections now open)
2018-06-28 11:21:38.737 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:38.737-0400 I NETWORK [initandlisten] connection accepted from 127.0.0.1:51566 #4 (4 connections now open)
2018-06-28 11:21:38.739 INFO 1804 --- [ Thread-12] o.s.b.a.mongo.embedded.EmbeddedMongo : 2018-06-28T11:21:38.738-0400 I NETWORK [initandlisten] connection accepted from 127.0.0.1:51567 #5 (5 connections now open)
2018-06-28 11:21:38.740 INFO 1804 --- [ main] c.g.l.LearningSpringBootApplication : Started LearningSpringBootApplication in 5.693 seconds (JVM running for 6.278)
2018-06-28 11:21:38.750 INFO 1804 --- [ Thread-17] org.mongodb.driver.connection : Opened connection [connectionId{localValue:4, serverValue:4}] to localhost:51561
2018-06-28 11:21:38.750 INFO 1804 --- [ Thread-20] org.mongodb.driver.connection : Opened connection [connectionId{localValue:5, serverValue:5}] to localhost:51561
2018-06-28 11:21:38.750 INFO 1804 --- [ Thread-18] org.mongodb.driver.connection : Opened connection [connectionId{localValue:3, serverValue:3}] to localhost:51561
com.greglturnquist.learningspringboot.Chapter#2043a52c
com.greglturnquist.learningspringboot.Chapter#5919de11
com.greglturnquist.learningspringboot.Chapter#393e1e5
2017-09-06 11:58:16.380 WARN 8376 --- [ry:/127.0.0.1:0] o.apache.zookeeper.server.NIOServerCnxn : caught end of stream exception
org.apache.zookeeper.server.ServerCnxn$EndOfStreamException: Unable to read additional data from client sessionid 0x15e55dfd1a70001, likely client has closed socket
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:228) ~[zookeeper-3.4.9.jar:3.4.9-1757313]
at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:203) [zookeeper-3.4.9.jar:3.4.9-1757313]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_112]
2017-09-06 11:58:16.381 INFO 8376 --- [ry:/127.0.0.1:0] o.apache.zookeeper.server.NIOServerCnxn : Closed socket connection for client /127.0.0.1:53191 which had sessionid 0x15e55dfd1a70001
2017-09-06 11:58:16.427 INFO 8376 --- [127.0.0.1:53184] org.I0Itec.zkclient.ZkEventThread : Terminate ZkClient event thread.
2017-09-06 11:58:16.428 INFO 8376 --- [0 cport:53184):] o.a.z.server.PrepRequestProcessor : Processed session termination for sessionid: 0x15e55dfd1a70000
2017-09-06 11:58:16.494 INFO 8376 --- [ main] org.apache.zookeeper.ZooKeeper : Session: 0x15e55dfd1a70000 closed
2017-09-06 11:58:16.496 INFO 8376 --- [ main] o.a.zookeeper.server.ZooKeeperServer : shutting down
2017-09-06 11:58:16.497 ERROR 8376 --- [ main] o.a.zookeeper.server.ZooKeeperServer : ZKShutdownHandler is not registered, so ZooKeeper server won't take any action on ERROR or SHUTDOWN server state changes
2017-09-06 11:58:16.497 INFO 8376 --- [ main] o.a.zookeeper.server.SessionTrackerImpl : Shutting down
2017-09-06 11:58:16.497 INFO 8376 --- [ main] o.a.z.server.PrepRequestProcessor : Shutting down
2017-09-06 11:58:16.497 INFO 8376 --- [ main] o.a.z.server.SyncRequestProcessor : Shutting down
2017-09-06 11:58:16.494 INFO 8376 --- [ain-EventThread] org.apache.zookeeper.ClientCnxn : EventThread shut down for session: 0x15e55dfd1a70000
2017-09-06 11:58:16.495 WARN 8376 --- [ry:/127.0.0.1:0] o.apache.zookeeper.server.NIOServerCnxn : caught end of stream exception
org.apache.zookeeper.server.ServerCnxn$EndOfStreamException: Unable to read additional data from client sessionid 0x15e55dfd1a70000, likely client has closed socket
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:228) ~[zookeeper-3.4.9.jar:3.4.9-1757313]
at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:203) [zookeeper-3.4.9.jar:3.4.9-1757313]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_112]
2017-09-06 11:58:16.498 INFO 8376 --- [ry:/127.0.0.1:0] o.apache.zookeeper.server.NIOServerCnxn : Closed socket connection for client /127.0.0.1:53187 which had sessionid 0x15e55dfd1a70000
2017-09-06 11:58:16.499 INFO 8376 --- [0 cport:53184):] o.a.z.server.PrepRequestProcessor : PrepRequestProcessor exited loop!
2017-09-06 11:58:16.499 INFO 8376 --- [ SyncThread:0] o.a.z.server.SyncRequestProcessor : SyncRequestProcessor exited!
2017-09-06 11:58:16.500 INFO 8376 --- [ main] o.a.z.server.FinalRequestProcessor : shutdown of request processor complete
2017-09-06 11:58:16.501 INFO 8376 --- [ry:/127.0.0.1:0] o.a.z.server.NIOServerCnxnFactory : NIOServerCnxn factory exited run method
2017-09-06 11:58:16.506 INFO 8376 --- [ SessionTracker] o.a.zookeeper.server.SessionTrackerImpl : SessionTrackerImpl exited loop!
2017-09-06 11:58:17.542 INFO 8376 --- [ Thread-9] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#2de366bb: startup date [Wed Sep 06 11:58:09 IST 2017]; root of context hierarchy
2017-09-06 11:58:17.560 INFO 8376 --- [ Thread-9] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147483647
2017-09-06 11:58:17.560 INFO 8376 --- [ Thread-9] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0
I have looked through these links where a similar exception is discussed:
https://issues.apache.org/jira/browse/ZOOKEEPER-1582
https://issues.apache.org/jira/browse/SOLR-4793
I have tried using jute.maxbuffer=50000000 in zookeeper.properties file as I'm using Kafka-setup-packaged-zookeeper. This solution was mentioned in the above JIRA tickets. But the exception still occurred.
Any suggestions what could be the possible solution, in my case?