Hi Miguel,
I really like these questions, as they're often asked by a solution architect and requires some deep insight into the possibilities of Mendix. And as architects always say: it depends...
Implementing custom Java in your Mendix application requires some extra skills. Having these onboard will put you to the question: should I build this fully in Java or can I link this to Low Code like Mendix. What were your considerations to implement this in Mendix?
Mendix is easy to implement in combination with REST and Soap API's, some other connectors are available via the Marketplace (like Kafka etc.). If you really need Java SDK's, you're on the path of custom Java Actions, developing your own connector module. You can initialize listeners by triggering some Java in the after startup microflow and trigger 'senders' using Java actions elsewhere. Depending on the structure, I would suggest to keep the custom Java to a minimum and do the most in Mendix, for example: pass along JSON for your connector and do import and export mapping using the native Mendix components.
You could also consider middleware, where a separate Java application converts messages from and to REST; this is mainly applicable for communication modules; not sure if this applies to you.
If you want to proceed developing in Mendix, you could take a look to the OIDC module for example, to see their Afterstartup microflow registering custom endpoints.
Good luck!
Johan