-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MQTT Adapter disconnect #460
Comments
Which version of the MQTT sink are you using? I am deprecating the first because of issues like this.
|
Devices = Devices.xml Adapters { machine1 { } Logger Configurationlogger_config |
shdr adapter disconnect sets all tags to UNAVAILABLE. 2024-06-13T14:50:00.973341Z (0x000057d4) [debug] Connector::reader->Connector::reconnect->Connector::close: Disconnected from adapter, setting all values to UNAVAILABLE But mqtt adapter (Broker) disconnect does not. |
Should this be a param? ON/OFF Use case...broker is 2nd adapter for sensors? USe case...Broker is primary adapter and should set all tags to UNAVAILABLE. Maybe an adapter level parameter 'Primary=true' |
This sounds reasonable behavior. I will take a look and see what it is doing now. May be a couple of days. |
The disconnect behavior is built into the agent. Must not be forwarding disconnect from broker signal. Is this when the broker disconnects or when the source disconnects from the broker? |
In this test case, I pulled the network cable causing the disconnect from the broker. For the shdr test, I just turned off my local adapter. |
Thanks. I'll disconnect my broker and test the behavior. |
@neildes2 Please test |
Downloading and testing now.... |
This issue is NOT resolved. tested on Agent v2.3.0.11 All tags do NOT reset to UNAVAILABLE upon mqtt broker ingest disconnect. |
Only the observations from the adapter will be set to unavailable. Check to see if any are reset. I tested it and when I killed the broker they reset to unavailable.
|
when I tested the shdr adapter, the device AVAILABILITY tag went UNAVAILABLE. When I tested with broker adapter, it did not. |
Did the shdr adapter set the availability item to AVAILABLE? I will check to see if how auto available is handled.
|
The shdr adapter, when disconnected, set AVAILABILITY to UNAVAILABLE |
I think I found the issue.
|
Just tested v2.3.0.13. When I disable my wireless connection, the broker adapter disconnects and the agent states...."] MqttClientImpl::disconnected: Disconnected from adapter, setting all values to UNAVAILABLE". But the device Tags all remain stale at AVAILABILITY=AVAILABLE and EXECUTION = ACTIVE. Even the AGENT device AVAILABILITY remains AVAILABLE |
Devices = Devices.xml |
Are you using the docker hub image? |
No. Downloading the WINDOWS compiled agent from this repo |
Agent device should be available. If the agent is running. |
If I have TWO adapters defined that feed to one device, and only ONE of them gets disconnected, what happens? |
If two adapters are associated with the device, the data items set by each adapter will become unavailable if it disconnects. The others will not. Availability is controlled by the first adapter using AutoAvailable=true (default). This will allow the adapter to control the Availability data item. I think any adapter with AutoAvailable true will try to set Availability when it disconnects. If availability is directly set by an adapter, then it will be associated with only that adapter. The source of the data and the disconnect only effect the data items associated with the adapter. The code marks all data items and the last adapter they received data from. |
Use I found some issues with the adapter data item connection. Just created a new PR. |
works as expected now! Great work. |
I have an v2.3.0.2 agent connected to a broker for mqtt ingress. Working great. But when it loses connection, shouldn't the agent set all tags to UNAVAILABLE? I have stale data for days.
The text was updated successfully, but these errors were encountered: