Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to replace binary separator with pipe #509

Merged

Conversation

Nadia-Adaptive
Copy link
Contributor

A change to FixArchivePrinter to allow replacing the binary separator in the FIX message body with a pipe via program arguments.

@vyazelenko
Copy link
Contributor

@Nadia-Adaptive Have you considered adding --delimiter=X so that any character can be specified?

@@ -387,8 +405,8 @@ private static void print(
{
final MessageStatus status = message.status();
final long timestamp = message.timestamp();
final String body = message.body();
System.out.printf("%1$20s: %2$s (%3$s)%n", timestamp, body, status);
final String body = pipeDelimiter ? message.body().replace('\u0001', '|') : message.body();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how far you would like to take this, but SOH could also appear in data fields, so you might end up with pipe symbols in fields that should not be replaced.
But I think this approach is good enough for the majority of cases.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks. I think this is good enough for now, fix.core.debug.separator doesn't handle data fields either.

@wojciech-adaptive
Copy link
Collaborator

@Nadia-Adaptive Have you considered adding --delimiter=X so that any character can be specified?

We should implement this.

@@ -387,8 +405,8 @@ private static void print(
{
final MessageStatus status = message.status();
final long timestamp = message.timestamp();
final String body = message.body();
System.out.printf("%1$20s: %2$s (%3$s)%n", timestamp, body, status);
final String body = pipeDelimiter ? message.body().replace('\u0001', '|') : message.body();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks. I think this is good enough for now, fix.core.debug.separator doesn't handle data fields either.





Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

@wojciech-adaptive wojciech-adaptive merged commit de96fa2 into real-logic:master Jun 12, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants