Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
anuvaad
OpenNMT-py
Commits
7c245400
Commit
7c245400
authored
4 years ago
by
aj7tesh
Browse files
Options
Download
Patches
Plain Diff
changed bootstrap server conf for dev
parent
a56b033f
master
dependabot/pip/flask-cors-3.0.9
experiments
release_anuvaad
release_anuvaad_users
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
kafka_utils/consumer.py
+1
-1
kafka_utils/consumer.py
kafka_utils/producer.py
+1
-1
kafka_utils/producer.py
with
2 additions
and
2 deletions
+2
-2
kafka_utils/consumer.py
+
1
−
1
View file @
7c245400
...
...
@@ -19,7 +19,7 @@ def get_consumer(topics):
# group_id=group_id,
# value_deserializer=lambda x: json.loads(x.decode('utf-8')))
consumer
=
KafkaConsumer
(
bootstrap_servers
=
[
bootstrap_server
]
,
bootstrap_servers
=
list
(
str
(
bootstrap_server
).
split
(
","
))
,
value_deserializer
=
lambda
x
:
json
.
loads
(
x
.
decode
(
'utf-8'
)))
consumer
.
subscribe
(
topics
)
...
...
This diff is collapsed.
Click to expand it.
kafka_utils/producer.py
+
1
−
1
View file @
7c245400
...
...
@@ -10,7 +10,7 @@ bootstrap_server = os.environ.get(KAFKA_IP_HOST,default_value)
def
get_producer
():
try
:
producer
=
KafkaProducer
(
bootstrap_servers
=
[
bootstrap_server
]
,
producer
=
KafkaProducer
(
bootstrap_servers
=
list
(
str
(
bootstrap_server
).
split
(
","
))
,
value_serializer
=
lambda
x
:
json
.
dumps
(
x
).
encode
(
'utf-8'
))
logger
.
info
(
'get_producer : producer returned successfully'
)
return
producer
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets