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

  1. 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
  2. Connect the session with client.connect().get(); the client auto-reconnects on drops until disconnect() is called
  3. 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
  4. Read a value with node.readValue() on a UaVariableNode, or call client.read(maxAge, TimestampsToReturn.Both, readValueIds).get() for the low-level Read service
  5. Create a subscription with ManagedSubscription.create(client), then subscription.createDataItem(nodeId) to add a MonitoredItem
  6. Register subscription.addChangeListener(...) to receive onDataReceived callbacks for value changes

Known gotchas

Related routes

Read and subscribe to OPC UA server nodes from a Node-RED flow using node-red-contrib-opcua
npmjs.com · 6 steps · unrated
Read a node value from an OPC UA server using the open62541 C client
open62541.org · 6 steps · unrated
Browse an OPC UA server's address space and subscribe to data changes from a client
reference.opcfoundation.org · 6 steps · unrated

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?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans