Connect, browse, read, and subscribe to nodes on an OPC UA server using Eclipse Milo (Java SDK)
domain: github.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Discover endpoints with DiscoveryClient.getEndpoints(endpointUrl).get(), then build a client via OpcUaClient.create(endpointUrl, endpointPredicate, configBuilder), filtering for securityPolicyUri == SecurityPolicy.None for an unsecured test connection
Connect the session with client.connect().get(); the client auto-reconnects on drops until disconnect() is called
Get the address space with client.getAddressSpace() and browse via addressSpace.browseNodes(node), or use the lower-level client.browse(BrowseDescription) and handle BrowseNext continuation points manually
Read a value with node.readValue() on a UaVariableNode, or call client.read(maxAge, TimestampsToReturn.Both, readValueIds).get() for the low-level Read service
Create a subscription with ManagedSubscription.create(client), then subscription.createDataItem(nodeId) to add a MonitoredItem
Register subscription.addChangeListener(...) to receive onDataReceived callbacks for value changes
Known gotchas
The selected EndpointDescription's UserTokenPolicy must match the configured IdentityProvider (AnonymousProvider is default)
Always check ManagedDataItem.getStatusCode().isGood() after creating a data item — a bad status means the MonitoredItem was rejected server-side
The low-level OpcUaClient#browse does not auto-follow BrowseNext continuation points; AddressSpace#browseNodes does
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?