apache / plc4x

PLC4X The Industrial IoT adapter
https://plc4x.apache.org/
Apache License 2.0
1.19k stars 388 forks source link

[REFACTOR]: Go over the EventPlcConnection interface in the API #1407

Open chrisdutz opened 4 months ago

chrisdutz commented 4 months ago

What would you like to happen?

The API contains a type EventPlcConnection which is an inteface that doesn't quite align with the rest of the API.

I think we should possibly have a more detailed look at this.

Programming Languages

Protocols

splatch commented 2 months ago

The historic context of this connection is fairly basic: 1) User application has no ways to determine state of connection, we internally process connected/disconnected events, but user never actually knows if connection was terminated by remote until it gets an error. Getting a ConnectionListener allows to track lifecycle of connection and act accordingly. 2) There is no way to simplify track low level traffic other than tapping a wireshark, which can be troublesome under production environments. Possibility to attach MessageExchangeListener provides interception point for user application to get messages in raw form.

That's whole motivation of it. Given that our API didn't have above concepts they were built as a supplement with this extra interface. It would be ideal if they could travel to the SPI.