camel-plc4x: Added autoReconnect uri parameter#8971
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 If necessary Apache Camel Committers may access logs and test results in the job summaries! |
Components tested:
|
| plc4XEndpoint.reconnect(); | ||
| LOGGER.debug("Successfully reconnected"); | ||
| } catch (PlcConnectionException e) { | ||
| LOGGER.error("Unable to reconnect, skipping request", e); |
There was a problem hiding this comment.
Maybe tone down the logging to WARN as you are dealing with this error by skipping.
|
In case the connection is NOT connected and auto reconnect = false, would the connection be "bad" all the time, or can the connection somehow re-establish itself and become working again ? |
Components tested:
|
The connection could be re-established manually, for example in a custom processor by using Plc4XEndpoint.getConnection().connect(). The connection cannot re-establish itself in any way before my changes. |
Components tested:
|
* camel-plc4x: Added autoReconnect uri parameter * camel-plc4x: fix autoReconnect parameter style * camel-plc4x: autoReconnect parameter, log level to warn (code review) Co-authored-by: Stein Overtoom <stein.overtoom@triopsys.nl>
* camel-plc4x: Connection now established in doStart() of Producer/Consumer instead of constructors (#8967) Co-authored-by: Stein Overtoom <stein.overtoom@triopsys.nl> * camel-plc4x: Added autoReconnect uri parameter (#8971) * camel-plc4x: Added autoReconnect uri parameter * camel-plc4x: fix autoReconnect parameter style * camel-plc4x: autoReconnect parameter, log level to warn (code review) Co-authored-by: Stein Overtoom <stein.overtoom@triopsys.nl> * camel-plc4x Implemented Plc4XPollingConsumer and some refactoring (CAMEL-18861) (#9254) * camel-plc4x: fixed Plc4XComponentTest unit test (CAMEL-18861) * camel-plc4x: Implemented Plc4XPollingConsumer (CAMEL-18861) * camel-plc4x: Refactored building ReadRequest into separate method (CAMEL-18861) * camel-plc4x: Improved auto-reconnect (CAMEL-18861) - An exchange with an empty map is created when no connection could be made, instead of no exchange at all - shuts down endpoint if auto-reconnect is turned off and connection is lost (upon first request) * camel-plc4x: Moved connection unit test from producer to endpoint test (CAMEL-18861) * camel-plc4x: Fixed unit tests, removed reflection from Endpoint and Producer tests and fixed canWrite bug in Producer (CAMEL-18861) * camel-plc4x: Exceptions are now only logged at trace level (CAMEL-18861) * camel-plc4x: Updated readme with PollingConsumer (CAMEL-18861) * camel-plc4x: Fixed formatting after Psourcecheck (CAMEL-18861) * camel-plc4x: Removed unused imports in Plc4XConsumer (CAMEL-18861) * camel-plc4x: Ran formatter (CAMEL-18861) --------- Co-authored-by: Stein Overtoom <stein.overtoom@triopsys.nl> * camel-plc4x: Fixed inconsistently passing/failing unit test (CAMEL-18861) (#9280) Co-authored-by: Stein Overtoom <stein.overtoom@triopsys.nl> --------- Co-authored-by: Stein Overtoom <stein.overtoom@triopsys.nl>
I don't have a JIRA account yet, so I couldn't create an issue (I send an email to private@camel.apache.org, is that the right approach?).
I added an uri parameter "autoReconnect". If enabled, when a request is made and there is no connection, an attempt to reconnect is made.