hyslopc opened a new issue, #1896:
URL: https://github.com/apache/plc4x/issues/1896

   ### What happened?
   
   **Current behavior:** An OPC-UA subscription request with N tags will return 
a collection of N identical PlcSubscriptionHandles.  Registering a handler for 
all of these handles will result in N callbacks for every tag.  Registering a 
handler for just one of these handles and ignoring all of the others will 
result in one callback for every tag change.
   
   **Expected behavior:** Registering a handler for every subscription handle 
returned by a subscription request (as described in the documentation, 
literally a copy/paste of the example from the PLC4X docs) should result in a 
single callback to the handler for every tag change, not multiple callbacks.  
In order to achieve this, either the subscription request should return one 
single PlcSubscriptionHandle, or N unique PlcSubscriptionHandles.
   
   **Example showing the problem:**
   ```
   PlcSubscriptionRequest subReq = opcConnector.subscriptionRequestBuilder()
         .addChangeOfStateTagAddress("Weight", "Weight")
         .addChangeOfStateTagAddress("Jam", "Jam")
         .addChangeOfStateTagAddress("HeightAlarm", "HeightAlarm")
         .build();
   
   Collection<PlcSubscriptionHandle> shs = 
subReq.execute().get().getSubscriptionHandles();</code>
   ```
   After the above code is executed, shs now contains 3 identical 
PlcSubscriptionHandles.  If 3 more tags were to be added to the subscription 
request, then shs would contain 6 identical PlcSubscriptionHandles.
   
   ### Version
   
   v0.13.0
   
   ### Programming Languages
   
   - [X] plc4j
   - [ ] plc4go
   - [ ] plc4c
   - [ ] plc4net
   
   ### Protocols
   
   - [ ] AB-Ethernet
   - [ ] ADS /AMS
   - [ ] BACnet/IP
   - [ ] CANopen
   - [ ] DeltaV
   - [ ] DF1
   - [ ] EtherNet/IP
   - [ ] Firmata
   - [ ] KNXnet/IP
   - [ ] Modbus
   - [X] OPC-UA
   - [ ] S7


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to