Skip to content

Commit

Permalink
[Java] Use AeronEvent when logging onPublicationError and add additio…
Browse files Browse the repository at this point in the history
…nal parameters.
  • Loading branch information
vyazelenko committed Dec 16, 2024
1 parent 8ac261b commit 8efa0e7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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, <code>null</code> 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;
}
Expand Down
14 changes: 12 additions & 2 deletions aeron-driver/src/main/java/io/aeron/driver/DriverConductor.java
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8efa0e7

Please sign in to comment.