Register requested consumers with opc ua subscriptions - #2251
Register requested consumers with opc ua subscriptions#2251JonasH-munters wants to merge 1 commit into
Conversation
|
also not sure, but I think @chrisdutz did something with subscriptions but my memories are a bit foggy |
|
Have to ask for a friend too. Did we have any changes in subscription handling logic? I do not recall a tag consumer from before. |
|
I assumed that the intention was there to support a consumer per tag since If you know some reason to not allow implementing consumers per tag that would be unfortunate since I'd have to solve my use case in some other way, but I'd just have to adapt :D In that case I'm assuming that at least the consumer for the whole request is intended to be registered with the Subscription. In any case, if any of the types of consumers that can be added to the request shouldn't be used in the subscription might I suggest logging a message or something to the developer so that they can see that they are trying to do something that won't have an effect? That'd have saved me time at least when I was troubleshooting why all the consumers I added were never called. (getting a bit ahead of things since this last paragraph is irrelevant if this PR is accepted as is). |
|
Per tag subscriptions in case of OPC-UA are not very helpful because cyclic subscription receives all the tags each time, thus plc event you receive will always be complete. This is one of miss-conceptions when it comes to UA, that it will be based on value change, but actually it is not. In essence plc4x (subscriber) send a publish request and device answers with all values of subscribed tags. I am afraid of confusing users (I believe you may be one of confused ones), by supporting both modes. From code point of view I do not mind any of these changes, but from consistency point of view we should clarify expected behavior at PLC4X API level. |
|
Thank you for the response and I definitely think I might be one of the confused ones so any clarifications that can be done on the PLC4X API level as a result of this PR will be great I think :D Just gotta figure out the best clarifications to do! What you say makes sense for cyclic subscriptions so maybe removing the |
|
Currently traveling at community over code.. So limited brain capacity. Initially subscriptions were only tag based. But it was super annoying and a performance nightmare. I added support for global handlers for all tags. Possibly I didn't finish the opcua integration correctly. |
|
Thank you for your response and no worries! Happy to continue this when you're done traveling and hope you have a good time at community over code. That makes a lot of sense explaining why the code looks like it does right now. Do you think it makes more sense to keep allowing for both tag based consumers and a global consumer when subscribing like in this PR right now? Or should I adjust the implementation to only support a global consumer? |
|
I do think that both options make sense. I'm personally more a fan of the global consumer pattern, but I do understand if some people more like the other. We just need to ensure both options are implemented by our drivers. |
|
Great! Then it sounds like I leave the code as-is, implementing support for both options for opc ua, until the PR can be reviewed. |
|
@JonasH-munters With above I believe we are good to go. Can you please squash and sign-off result commit so I can merge this with your email/name? |
|
Great! Yes I can do that. Just to double check, I should squash the three commits into one and sign that using GPG? Sorry for the potentially stupid question, a bit new to contributing to open source. |
|
No need for GPG, just sign-off with your real name. I'd strongly encourage you to sign Contributor License Agreements described here: https://www.apache.org/licenses/contributor-agreements.html. It clarifies the legal / copyright / license side for you and others who would like to use library later on. |
cbb2436 to
3c21d78
Compare
|
I have now squashed the commits into one, but I don't know if it's signed off. I have my real name set in my git config and on my github profile. Don't know if there's some more place it needs to be set? |
|
If you use a command line just do |
Signed-off-by: Jonas Halvarsson <jonas.halvarsson@munters.com>
3c21d78 to
8d9fd1a
Compare
|
Ah, that feature was new to me, I've signed off the commit now. Thanks for explaining! That should be it for this PR to be merged, right? |
|
Hello! Sorry to bother you again, but it seems like while the checks needed to merge this ran yesterday one of them just got stuck and timed out after 6h. Should this just be re-ran or is there something I need to do? |
|
Unfortunately that's quite usual. In the opcua test and the go build this happens in a few percent of the job runs. Given we do a lot of concurrent runs, I usually simply rerun failed jobs. |
|
Great, thanks for the response and for rerunning! Look like everything should be ready to merge then :D |
|
Hello! Excuse the ping again, I just wanted to double check if anything else is required of me since this seems to have been approved, but not merged yet. I'm absolutely fine with waiting, just wanted to be sure that's what I'm supposed to do so I'm not wasting time when I should be doing something :D |
|
Thank you for the response! I was not waiting for anyone in particular, just wanted to clarify so that you guys weren't waiting for me and I didn't know about it :D |
|
Merged manually in 34a9db2. |
|
Thanks a lot! |
|
Thank you for contributing to the project. :-) |
This handles issue 2238.
Currently, when requesting an opc ua subscription any consumers in the request will never be called. This PR registers any consumers for the whole subscription with the subscription handle. It also adds support for registering consumers for individual tags (as can be added to the request already) and registers those with the subscription handle as well.
Ps. The link to the contributing guidelines is broken so I hope I'm not breaking any :D