codekundan commented on issue #1896:
URL: https://github.com/apache/plc4x/issues/1896#issuecomment-2486386294

   > > It is working for me, but I think there are some problems with 
subscriptions with the current PLC4X code, the code is polling constantly once 
per second
   > 
   > @codekundan @hyslopc AFAIR you can try to adjust that, you need to use 
cyclic subscription. Cycle duration used for first tag will dictate cycle time 
for polling OPC-UA server: 
https://github.com/apache/plc4x/blob/v0.12.0/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/protocol/OpcuaProtocolLogic.java#L768
   > 
   > If not provided it is assumed to be 1s. OPC-UA protocol itself requires 
publish request to receive publish response with changed tag values, so you can 
reduce load, at the cost of bigger delay since possible value change.
   > 
   > > I don't think there's any time limit on subscriptions, but they are only 
valid for the lifetime of the channel, and there is a channel-lifetime setting, 
which defines the maximum amount of time the channel will be open (in fact the 
server must leave the channel open 25% longer than this). Default is one hour, 
so after 75 minutes, you will be disconnected, unless you specify a higher 
channel-lifetime
   > 
   > Channel lifetime is declared by server, when secure channel is open or 
renewed. For that reason we do not have a setting for that, we just rely on 
what server wants. If you suspect any resource leak then renewing of channel 
might possibly be guilty (AFAIR it was guilty of some thread leak before), 
other place could be subscription handles which also need to submit 
asynchronously a publish request, beside your application logic. Look at these 
two places (OpcSubscriptionHandle.java and SecureChannel.java). If you have a 
lot of connect/disconnect cycles then both will fail to properly manage threads 
started within their internals.
   
   @splatch I will look into the files you mentioned. Will try Cyclic 
subscription and get back to you.


-- 
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