Skip to content

camel-plc4x: Added autoReconnect uri parameter#8971

Merged
davsclaus merged 3 commits intoapache:mainfrom
SteinOv:plc4xAutoReconnectParameter
Jan 4, 2023
Merged

camel-plc4x: Added autoReconnect uri parameter#8971
davsclaus merged 3 commits intoapache:mainfrom
SteinOv:plc4xAutoReconnectParameter

Conversation

@SteinOv
Copy link
Contributor

@SteinOv SteinOv commented Jan 4, 2023

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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

🌟 Thank you for your contribution to the Apache Camel project! 🌟

⚠️ Please note that the changes on this PR may be tested automatically.

If necessary Apache Camel Committers may access logs and test results in the job summaries!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

Components tested:

Total Tested Failed ❌ Passed ✅
1 1 1 0

plc4XEndpoint.reconnect();
LOGGER.debug("Successfully reconnected");
} catch (PlcConnectionException e) {
LOGGER.error("Unable to reconnect, skipping request", e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe tone down the logging to WARN as you are dealing with this error by skipping.

@davsclaus
Copy link
Contributor

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 ?

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

Components tested:

Total Tested Failed ❌ Passed ✅
1 1 1 1

@SteinOv
Copy link
Contributor Author

SteinOv commented Jan 4, 2023

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 ?

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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

Components tested:

Total Tested Failed ❌ Passed ✅
1 1 0 2

@davsclaus davsclaus merged commit bcf6b1b into apache:main Jan 4, 2023
SteinOv added a commit to SteinOv/camel that referenced this pull request Feb 1, 2023
* 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>
davsclaus pushed a commit that referenced this pull request Feb 1, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants