I am using an API - Tranquility - to send messages to Druid.
Looking at the documentation and the example code, it looks like the sender is asynchronous and thread safe.
Here is the Java Example from the API.
My question is regarding design / pattern to apply when I have to create multiple senders with different configurations and being able to re-use them.
Senders are capable of sending over 100k messages per second, so I don't want to re-load the configs for sender.
My ideas is to create a factory of senders and get a specific sender based on the message type and send the messages.
Thoughts?
Aucun commentaire:
Enregistrer un commentaire