Kafka on Google Cloud Platform Integration with Spring Boot - spring-boot

I am running Kafka on GCP and sending message to Topic from Spring Boot App.
In GCP consumer window, messages are not getting displayed.
I have allowed all firewall access to my VM which is running Kafka.
Any thoughts??
Exception in spring IDE console
2018-10-10 00:25:06.819 INFO 4472 --- [nio-8080-exec-1]
o.a.kafka.common.utils.AppInfoParser : Kafka version : 1.0.2
2018-10-10 00:25:06.820 INFO 4472 --- [nio-8080-exec-1]
o.a.kafka.common.utils.AppInfoParser : Kafka commitId :
2a121f7b1d402825
2018-10-10 00:25:38.158 ERROR 4472 --- [ad | producer-1]
o.s.k.support.LoggingProducerListener : Exception thrown when
sending a message with key='null' and payload='888' to topic test:
org.apache.kafka.common.errors.TimeoutException: Expiring 1 record(s)
for test-0: 30034 ms has passed since batch creation plus linger time .

Related

Spring Boot AWS logging level

I have several Spring Boot micro services that connect to Config Server and Eureka. All are running inside Docker container in ECS. They are very chatty and I would like to eliminate the non-critical messages.
2023-01-06 16:42:03.426 WARN 1 --- [tbeatExecutor-0]
c.n.d.s.t.d.RetryableEurekaHttpClient : Request execution failed with
message... 2023-01-06 16:43:28.082 INFO 1 --- [trap-executor-0]
c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via
configuration... 2023-01-06 16:50:03.679 INFO 1 --- [freshExecutor-0]
o.apache.http.impl.execchain.RetryExec... 2023-01-06 16:42:03.426 INFO
1 --- [tbeatExecutor-0] c.n.d.s.t.d.RedirectingEurekaHttpClient...
And each service has its application.properties file with the following:
logging.level.org.springframework.cloud.netflix.eureka.http=FATAL
logging.level.com.netflix.discovery=FATAL
logging.level.com.netflix.discovery.shared.resolver.aws = ERROR
logging.level.com.netflix.eureka.registry = ERROR
logging.level.org.springframework.web.servlet = FATAL
logging.level.org.hibernate = ERROR logging.level.com.zaxxer.hikari =
ERROR logging.level.org.apache.tomcat=ERROR
logging.level.org.apache.catalina=ERROR
But the messages continue to show up in the log files. I don't get why this is, since those messages are INFO and WARN.
In order to disable below error messages use the config below
logging.level.com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient=error
also in your config I see logging.level.org.springframework.web.servlet = FATAL logging.level.org.hibernate = this looks wrong, every line should have one gorup name = something, then new line.

Spring Boot and Hikari Data Source, server shutting down

I'm writing and application (Angula Dart for front end, Spring Boot for back end) and I have a backbone of functionality already up. I'm facing an issue now, time to tome (can't say if there is a specific timing or if is pure random) the application shutdown itself.
[ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-12-14 18:11:27.551 INFO 278601 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-12-14 18:11:27.568 INFO 278601 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
Before those log line the application is working without any problems (there is a certai amount of inactivity of the server, it recives few requestes over the day).
This is the command i use to launch the app
java -Duser.country=IT -Duser.language=it -Dserver.port=4499 -jar whServer.jar > whServer.log 2> whServer-error.log&
Before the shtdown there are no applicative errors

How to get resolve ElasticSearch warning message "Transport Handler Not Found" on spring boot application console?

We have two Spring boot applications using the same Elasticsearch database. The queries work fine. But the console of the second spring boot application is always flooded with these warning messages as soon as it boots up. Is there any configuration we are missing, either in the Spring boot app or at Elasticsearch?
2021-02-16 16:15:03.757 INFO 19828 --- [main] o.s.d.e.c.TransportClientFactoryBean: Adding transport node : 127.0.0.1:9300
2021-02-16 16:15:04.760 WARN 19828 --- [ient_boss][T#1]] o.e.transport.TransportService: Transport response handler not found of id [1]
2021-02-16 16:15:04.932 WARN 19828 --- [ient_boss][T#2]] o.e.transport.TransportService: Transport response handler not found of id [3]
2021-02-16 16:15:08.104 WARN 19828 --- [ient_boss][T#7]] o.e.transport.TransportService: Transport response handler not found of id [9]
2021-02-16 16:15:13.232 WARN 19828 --- [ient_boss][T#8]] o.e.transport.TransportService: Transport response handler not found of id [59]

Docker, Mongodb,Spring Boot on Windows getting Connection refused error

I am using default docker image of MongoDB and trying to connect using simple spring Boot application on windows box.
mongoDB image is getting stared correctly
IP in mongoDB image
I have spring-boot-starter-data-mongodb in my class path. i am using all spring boot default and only using below property in application.properties.
spring.data.mongodb.host=192.168.99.100
On application startup getting Connection refused: connect error
Logs
019-03-06 06:15:06.096 INFO 4664 --- [ main] org.mongodb.driver.cluster : Cluster created with settings {hosts=[192.168.99.100:27017], mode=MULTIPLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
2019-03-06 06:15:06.096 INFO 4664 --- [ main] org.mongodb.driver.cluster : Adding discovered server 192.168.99.100:27017 to client view of cluster
2019-03-06 06:15:06.356 WARN 4664 --- [ main] o.s.d.m.c.m.BasicMongoPersistentProperty : Customizing field name for id property not allowed! Custom name will not be considered!
2019-03-06 06:15:06.928 INFO 4664 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-03-06 06:15:07.164 INFO 4664 --- [68.99.100:27017] org.mongodb.driver.cluster : Exception in monitor thread while connecting to server 192.168.99.100:27017
What i am missing here ?
Not a MongoDB expert, but a moderate Docker user speaking: It looks like you are not publishing the port MongoDB runs by default: 27017. That's why your spring application could not get a connection and throws this exception:
Exception in monitor thread while connecting to server 192.168.99.100:27017
So you may try publishing the port by using -p 27017:27017when initiating mongo container.

Spring boot with spring.data.mongodb.uri=mongodb://otherhost/test

I developed a Spring boot application with MongoDB. While the MongoDB in the localhost, it works fine, but when the MongoDB is in different the server, I changed the setting in application.properties as
spring.data.mongodb.uri=mongodb://192.168.7.31/gcp
spring.data.mongodb.username=xxx
spring.data.mongodb.password=xxxxxxx
the application faileds as it still looks for the mongoDB in localhost
2017-01-04 11:47:46.161 INFO 15610 --- [ main] org.mongodb.driver.cluster : Adding discovered server localhost:27017 to client view of cluster
2017-01-04 11:47:46.218 INFO 15610 --- [localhost:27017] org.mongodb.driver.cluster : Exception in monitor thread while connecting to server localhost:27017
com.mongodb.MongoSocketOpenException: Exception opening socket
at com.mongodb.connection.SocketStream.open(SocketStream.java:63) ~[mongodb-driver-core-3.2.2.jar:na]
at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:114) ~[mongodb-driver-core-3.2.2.jar:na]
at com.mongodb.connection.DefaultServerMonitor$ServerMonitorR
Anyone can help to tell me how to set the parameters?

Resources