-
Notifications
You must be signed in to change notification settings - Fork 801
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
[feature request] expose methods for handling raw event data. #28
Comments
This should do the trick: BinaryLogClient client = ...
EventDeserializer eventDeserializer = new EventDeserializer(
new EventHeaderV4Deserializer(),
new ByteArrayEventDataDeserializer(),
new HashMap<EventType, EventDataDeserializer>() {{
// TABLE_MAP and ROTATE events are used internally by EventDeserializer/BinaryLogClient
put(EventType.TABLE_MAP, new TableMapEventDataDeserializer());
put(EventType.ROTATE, new RotateEventDataDeserializer());
}},
new HashMap<Long, TableMapEventData>()
);
client.setEventDeserializer(eventDeserializer); Alternatively, you can explicitly specify type of events that should skip payload deserialization. Like so: BinaryLogClient client = ...
EventDeserializer eventDeserializer = new EventDeserializer();
eventDeserializer.setEventDataDeserializer(EventType.EXT_WRITE_ROWS,
new ByteArrayEventDataDeserializer());
eventDeserializer.setEventDataDeserializer(EventType.EXT_UPDATE_ROWS,
new ByteArrayEventDataDeserializer());
eventDeserializer.setEventDataDeserializer(EventType.EXT_DELETE_ROWS,
new ByteArrayEventDataDeserializer());
client.setEventDeserializer(eventDeserializer); Let me know if that's enough. |
This looks great, is there any way this can be documented somewhere? I can see a lot of people using this if they want to setup a pub-sub with the binlog data. |
Added a few examples in 024ade9. |
jpechane
pushed a commit
to jpechane/mysql-binlog-connector-java
that referenced
this issue
Feb 18, 2021
Replace tls hostname verifier, upgrade to JDK 11
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would like to publish the raw event data, and then parse the event data on the subscribers to let them handle the events themselves.
The text was updated successfully, but these errors were encountered: