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

Support custom/unknown tags in codecs #462

Open
pcdv opened this issue Jun 1, 2022 · 0 comments
Open

Support custom/unknown tags in codecs #462

pcdv opened this issue Jun 1, 2022 · 0 comments

Comments

@pcdv
Copy link
Contributor

pcdv commented Jun 1, 2022

Artio codecs are nice in the sense that they are fast and make it easy to read values of known fields.

One thing that is hard is to be able to take into account some arbitrary custom fields (e.g. 10042=FOO). Right now, the only solution is to define a new field in the XML dictionary, regenerate codecs, then hardcode the processing of the tag. This makes it difficult to set up a configurable gateway, where custom tags can be copied/mapped to whatever we like (any config change requires a rebuild).

I haven't had time to think this through but I feel like it would be easy to set an "unknown tag listener" in a Decoder, so it is notified whenever an unknown tag is encountered. Something like this:

  @Override
  public void onUnknownTag(int tag, DirectBuffer buffer, int offset, int len) {
    ...
  }

This looks like something that could be nice and not that hard to strap on existing decoders.

Conversely, it would be nice to encode "unknown" fields through encoders. A quick and dirty way of doing it would be to declare a customFields buffer + customFieldsLength and some methods to populate/reset it.

What do you think? If time permits, I will try to experiment something and come up with a PR in case this is something of interest to other people.

@pcdv pcdv changed the title Flexible decoding of unknown FIX tags Support custom/unknown tags in codecs Jun 2, 2022
pcdv added a commit to pcdv/artio that referenced this issue Jul 6, 2022
pcdv added a commit to pcdv/artio that referenced this issue Jun 19, 2024
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

No branches or pull requests

1 participant