Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Unable to change port mappings #87

Open
Godsim opened this issue Apr 10, 2018 · 2 comments
Open

Unable to change port mappings #87

Godsim opened this issue Apr 10, 2018 · 2 comments

Comments

@Godsim
Copy link

Godsim commented Apr 10, 2018

Hi,
I seem to be unable to use different port mappings for this image in order to run different environments on the same machine. In conjunction with spring-kafka:2.1.4.RELEASE i get the following error:

2018-04-10 19:57:38.191 WARN 13318 --- [ntainer#0-0-C-1] org.apache.kafka.clients.NetworkClient : [Consumer clientId=consumer-1, groupId=notifications] Error while fetching metadata with correlation id 4 : {notifications.topic=LEADER_NOT_AVAILABLE}
2018-04-10 19:57:38.208 INFO 13318 --- [ Test worker] o.a.kafka.common.utils.AppInfoParser : Kafka version : 1.0.0
2018-04-10 19:57:38.208 INFO 13318 --- [ Test worker] o.a.kafka.common.utils.AppInfoParser : Kafka commitId : aaa7af6d4a11b29d
2018-04-10 19:57:38.228 WARN 13318 --- [ad | producer-1] org.apache.kafka.clients.NetworkClient : [Producer clientId=producer-1] Error while fetching metadata with correlation id 2 : {notifications.topic=LEADER_NOT_AVAILABLE}
2018-04-10 19:57:38.299 WARN 13318 --- [ntainer#0-0-C-1] org.apache.kafka.clients.NetworkClient : [Consumer clientId=consumer-1, groupId=notifications] Error while fetching metadata with correlation id 5 : {notifications.topic=LEADER_NOT_AVAILABLE}
2018-04-10 19:57:38.337 WARN 13318 --- [ad | producer-1] org.apache.kafka.clients.NetworkClient : [Producer clientId=producer-1] Error while fetching metadata with correlation id 3 : {notifications.topic=LEADER_NOT_AVAILABLE}
2018-04-10 19:57:38.406 WARN 13318 --- [ntainer#0-0-C-1] org.apache.kafka.clients.NetworkClient : [Consumer clientId=consumer-1, groupId=notifications] Error while fetching metadata with correlation id 6 : {notifications.topic=LEADER_NOT_AVAILABLE}
2018-04-10 19:57:38.445 WARN 13318 --- [ad | producer-1] org.apache.kafka.clients.NetworkClient : [Producer clientId=producer-1] Error while fetching metadata with correlation id 4 : {notifications.topic=LEADER_NOT_AVAILABLE}
...
and so on

docker-compose:
kafka:
container_name: integration_kafka
image: spotify/kafka:latest
ports:
- "9093:9092"
- "2182:2181"
environment:
ADVERTISED_HOST: 127.0.0.1
ADVERTISED_PORT: 9093
TOPICS: notifications.topic
GROUP_ID: notifications

bootstrap.yml:
spring:
kafka:
consumer:
auto-offset-reset: earliest
group-id: notifications
bootstrap-servers:
- 127.0.0.1:9093

Only if i run the container with the default mappings 9092:9092, 2181:2181 and the bootstrap servers set to 127.0.0.1:9092 it seems to work as intended. I'd be very thankful if you could point out my mistake... or care to correct yours ;-)

@Godsim
Copy link
Author

Godsim commented Apr 10, 2018

Unfortunately the indents were ignored, considering the bootstrap-servers, it's on spring.kafka.bootstrap-servers, not spring.kafka.consumer.bootstrap-servers!

@abendt
Copy link

abendt commented May 6, 2018

try to set ADVERTISED_HOST to the address of your docker host instead of 127.0.0.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants