File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 65
65
def acked (err , msg ):
66
66
"""Delivery report callback called (from flush()) on successful or failed delivery of the message."""
67
67
if err is not None :
68
- print ("failed to deliver message: {0 }" .format (err .str ()))
68
+ print ("failed to deliver message: {}" .format (err .str ()))
69
69
else :
70
- print ("produced to: {0 } [{1 }] @ {2 }" .format (msg .topic (), msg .partition (), msg .offset ()))
70
+ print ("produced to: {} [{}] @ {}" .format (msg .topic (), msg .partition (), msg .offset ()))
71
71
72
72
73
73
p .produce ('python-test-topic' , value = 'python test value' , callback = acked )
@@ -101,11 +101,11 @@ def acked(err, msg):
101
101
# the group to rebalance and start consuming.
102
102
continue
103
103
if msg .error ():
104
- # Most error message are typically temporary log error and continue.
104
+ # Errors are typically temporary, print error and continue.
105
105
print ("Consumer error: {}" .format (msg .error ()))
106
106
continue
107
107
108
- print ('consumed: {0 }' .format (msg .value ()))
108
+ print ('consumed: {}' .format (msg .value ()))
109
109
110
110
except KeyboardInterrupt :
111
111
pass
You can’t perform that action at this time.
0 commit comments