Skip to content

Commit 521d4c5

Browse files
committed
Handle cases where ServiceBus message has no payload
Apparently, a Service Bus message may have no payload at the protocol level, so the worker must account for that. Fixes: #330
1 parent b31ede8 commit 521d4c5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

azure/functions_worker/bindings/servicebus.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ def from_proto(cls, data: protos.TypedData, *,
131131
elif data_type == 'json':
132132
body = data.json.encode('utf-8')
133133

134+
elif data_type is None:
135+
# ServiceBus message with no payload are possible.
136+
# See Azure/azure-functions-python-worker#330
137+
body = b''
138+
134139
else:
135140
raise NotImplementedError(
136141
f'unsupported queue payload type: {data_type}')

0 commit comments

Comments
 (0)