From 8efa0e7f143639abe2e4233ae7c7269589ade358 Mon Sep 17 00:00:00 2001 From: Dmytro Vyazelenko <696855+vyazelenko@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:41:42 +0100 Subject: [PATCH] [Java] Use AeronEvent when logging onPublicationError and add additional parameters. --- .../io/aeron/status/PublicationErrorFrame.java | 6 +++--- .../main/java/io/aeron/driver/DriverConductor.java | 14 ++++++++++++-- .../java/io/aeron/driver/DriverConductorProxy.java | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/aeron-client/src/main/java/io/aeron/status/PublicationErrorFrame.java b/aeron-client/src/main/java/io/aeron/status/PublicationErrorFrame.java index 7b4ba93277..9642630e4b 100644 --- a/aeron-client/src/main/java/io/aeron/status/PublicationErrorFrame.java +++ b/aeron-client/src/main/java/io/aeron/status/PublicationErrorFrame.java @@ -29,7 +29,7 @@ public class PublicationErrorFrame implements Cloneable private int streamId; private long receiverId; private long destinationRegistrationId; - private Long groupTag; + private long groupTag; private int errorCode; private String errorMessage; private InetSocketAddress sourceAddress; @@ -77,10 +77,10 @@ public long receiverId() /** * Group tag of the source that sent the error frame. * - * @return group tag of the source that sent the error frame, null if the source did not have a group + * @return group tag of the source that sent the error frame or {@link io.aeron.Aeron#NULL_VALUE} if the source did not have a group * tag set. */ - public Long groupTag() + public long groupTag() { return groupTag; } diff --git a/aeron-driver/src/main/java/io/aeron/driver/DriverConductor.java b/aeron-driver/src/main/java/io/aeron/driver/DriverConductor.java index 576f3ff618..bf70928f3f 100644 --- a/aeron-driver/src/main/java/io/aeron/driver/DriverConductor.java +++ b/aeron-driver/src/main/java/io/aeron/driver/DriverConductor.java @@ -394,12 +394,22 @@ void onPublicationError( final int sessionId, final int streamId, final long receiverId, - final Long groupId, + final long groupId, final InetSocketAddress srcAddress, final int errorCode, final String errorMessage) { - recordError(new AeronException(errorMessage, AeronException.Category.WARN)); + recordError(new AeronEvent( + "onPublicationError: " + + "registrationId=" + registrationId + + ", destinationRegistrationId=" + destinationRegistrationId + + ", sessionId=" + sessionId + + ", streamId=" + streamId + + ", receiverId=" + receiverId + + ", groupId=" + groupId + + ", errorCode=" + errorCode + + ", errorMessage=" + errorMessage, + AeronException.Category.WARN)); clientProxy.onPublicationErrorFrame( registrationId, destinationRegistrationId, diff --git a/aeron-driver/src/main/java/io/aeron/driver/DriverConductorProxy.java b/aeron-driver/src/main/java/io/aeron/driver/DriverConductorProxy.java index cb7c2f2488..719abe16cb 100644 --- a/aeron-driver/src/main/java/io/aeron/driver/DriverConductorProxy.java +++ b/aeron-driver/src/main/java/io/aeron/driver/DriverConductorProxy.java @@ -253,7 +253,7 @@ void onPublicationError( final int sessionId, final int streamId, final long receiverId, - final Long groupId, + final long groupId, final InetSocketAddress srcAddress, final int errorCode, final String errorMessage)