Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

[MQTT 2.4] action stops functioning #6780

Open
911rgt opened this issue Jan 2, 2019 · 6 comments
Open

[MQTT 2.4] action stops functioning #6780

911rgt opened this issue Jan 2, 2019 · 6 comments

Comments

@911rgt
Copy link

911rgt commented Jan 2, 2019

Expected Behavior

Continued publishing of Mqtt messages.

Current Behavior

After upgrading 2.4 and switching to MQTT 2 I recreated the event-bus like behaviour with the following rule:

rule “Publish item changes”
when
Member of gTemperature changed
then
var state = “”
if (triggeringItem.state != null) {
state = triggeringItem.state.toString
val actions = getActions(“mqtt”,“mqtt:broker:myBroker”)
actions.publishMQTT("/myserver/"+triggeringItem.name+"/state",state)
logInfo(“log”, "publish: " + triggeringItem.name + " " + state)
}
end

While this rule works as expected it stops functioning after several hours and throws an error like: MQTT publish to failed!

The rule creates maximum 20 messages per minute so the load isn't that high.

I tried this on 2 different OpenHAB setups (one RPI 3b and one a more powerful VM) and same result.

Other users have reported similar behaviour.

Possible Solution

David Graeff suggested that this is related to the new publishMQTT action itself and that this might not be stress tested yet.

Steps to Reproduce

Create a rule as above which gets triggered frequently
Wait a few hours (max 24 hours)
Your Environment

openhab 2.4 release
raspian jessie and ubuntu 16.04

@davidgraeff
Copy link
Contributor

Kai has worked on getActions recently and it might be fixed by his changes. Need to be tested at some point.

@philippwaller
Copy link

I can confirm this issue. After a couple of hundred successful calls, I get the message "MQTT publish to openHAB/out/item/vBD_LightScene/ItemStateEvent failed!".
I use JSR223 Groovy Script instead of Xtend and initiate the MQTTAction at script execution time as a global variable via the ScriptServiceUtil.getActionServices() method. At time of rule execution, I load the instance from the global variable and don't call any factory method. So in my case, the issue appears after object creation.
I have the feeling that the error is caused by a certain load. If I quickly turn on and off 25 Hue lamps with 6 channels each and publish the state changes to the broker (300-400 msg/sec), I get the error message earlier. (NAS with 4x1,6Ghz Intel Celeron & 8GB RAM, Dockerized)

@davidgraeff
Copy link
Contributor

Can anybody confirm this with a 2.5m1 version?

@pavel-kamaev
Copy link

Still reproducible in 2.5M1.

@davidgraeff
Copy link
Contributor

Ok. This issue need to recreated on the openhab2 repository though. I will forget about it, if it is sitting here

@pavel-kamaev
Copy link

There is one already: https://github.com/openhab/openhab2-addons/issues/4498

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants