splatch commented on issue #1472:
URL: https://github.com/apache/plc4x/issues/1472#issuecomment-2033229692
@alexiskhoury I made an attempt to run 0.12 and 0.13-SNAPSHOT (current
develop) wit prosys simulation server, both looks fine. For me root cause of
troubles (why it didn't work in first run) was extra trailing slash after
`OPCUA/SimulationServer`. The endpoint matcher is strict, so it looks for exact
match.
Can you share log or strack trace you get?
Example program for 0.12+ releases:
```
String keystoreParams = "discovery=true"
+ "&application-uri=urn:apache:plc4x:client"
+ "&negotiation-timeout=60000"
+ "&security-policy=NONE"
+ "&message-security=NONE";
try (PlcConnection connection = new
DefaultPlcDriverManager().getConnection("opcua:tcp://arch:4840/OPCUA/SimulationServer?"
+ keystoreParams)) {
CompletableFuture<? extends PlcSubscriptionResponse> future =
connection.subscriptionRequestBuilder()
.addChangeOfStateTagAddress("c", "ns=0;i=2258")
.build().execute();
future.whenComplete((r, e) -> {
if (e != null) {
e.printStackTrace();
return;
}
r.getSubscriptionHandle("c").register(event -> {
for (String field : event.getTagNames()) {
System.out.println(field + " " +
event.getObject(field) + " " + event.getResponseCode(field));
}
});
}).get();
Thread.sleep(60_000);
} catch (PlcConnectionException e) {
throw new PlcRuntimeException(e);
} catch (Exception e) {
e.printStackTrace();
}
```
--
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]