ERROR: Invalid interpolation format for “command” option in service…
Doing some funky Docker Compose stuff, including:
Doing some funky Docker Compose stuff, including:
Data comes into Kafka in many shapes and sizes. Sometimes it’s from CDC tools, and may be nested like this:
(This was cross-posted on the Confluent.io blog)
This question comes up on StackOverflow and such places a lot, so here’s something to try and help.
tl;dr : You need to set advertised.listeners
(or KAFKA_ADVERTISED_LISTENERS
if you’re using Docker images) to the external address (host/IP) so that clients can correctly connect to it. Otherwise they’ll try to connect to the internal host address–and if that’s not reachable then problems ensue.
Put another way, courtesy of Spencer Ruport:
LISTENERS
are what interfaces Kafka binds to.ADVERTISED_LISTENERS
are how clients can connect.
tl;dr Use curl
to pull data from the Mockaroo REST endpoint, and pipe it into kafkacat
, thus:
curl -s "https://api.mockaroo.com/api/d5a195e0?count=2&key=ff7856d0"| \
kafkacat -b localhost:9092 -t purchases -P