Skip to content

Commit 5e154c2

Browse files
committed
Log message in case of stream publisher declaration failure
The "precondition failed" error code is good enough for an application, but it may be useful when working on a client library to have more information about the reason of the failure of the publisher declaration. This commit adds a warning log message that gives the reason(s) of the failure (publisher ID already taken and/or existing publisher with the same reference for the same stream in the connection).
1 parent 399659b commit 5e154c2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

deps/rabbitmq_stream/src/rabbit_stream_reader.erl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1747,7 +1747,12 @@ handle_frame_post_auth(Transport,
17471747
internal_sequence = InternalSequence + 1},
17481748
State}
17491749
end;
1750-
{_, _} ->
1750+
{PublisherIdTaken, ReferenceTaken} ->
1751+
rabbit_log:warning("Error while declaring publisher ~tp for stream '~ts', "
1752+
"with reference '~ts'. ID already taken: ~tp. "
1753+
"Reference already taken: ~tp.",
1754+
[PublisherId, Stream, WriterRef,
1755+
PublisherIdTaken, ReferenceTaken]),
17511756
response(Transport,
17521757
Connection0,
17531758
declare_publisher,

0 commit comments

Comments
 (0)