Skip to content

Commit 304d3ee

Browse files
committed
Added debug log if ordering key not string
1 parent e396c1f commit 304d3ee

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/resty/pubsub/producer.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,13 @@ function _M.send(self, message, attributes, ordering_key)
165165
attributes = attributes
166166
}
167167

168-
if type(ordering_key) == "string" then
169-
body_message['ordering_key'] = ordering_key
168+
169+
if ordering_key ~= nil then
170+
if type(ordering_key) == "string" then
171+
body_message['ordering_key'] = ordering_key
172+
else
173+
ngx.log(ngx.DEBUG, "Ordering key must be String hence dropping it ", ordering_key)
174+
end
170175
end
171176

172177
if self.ring_buffer == nil then

0 commit comments

Comments
 (0)