3

I'm trying to connect to a OPC UA server with camel. I downloaded the camel java template via mvn:archetype. This is what my route looks like:

public class MyRouteBuilder extends RouteBuilder {
    public void configure() {
        from("milo-client:tcp://10.0.75.1:4840")
            .log("From OPC UA: ${body}");
    }
}

No matter what server I try to connect to, I always get:

java.util.concurrent.ExecutionException: UaException: status=Bad_Timeout, message=io.netty.channel.ConnectTimeoutException: connection timed out: /172.17.0.2:4840

The OPC servers aren't the problem, I can reach all of them with any other client.

Am I missing something here? Thank you for your help.

Necrophades
  • 605
  • 7
  • 21
  • In such cases always start with using some reliable tool to check if it is your program or some setup in general. I recommend UA-Expert, very handy tool. – astrowalker Mar 25 '19 at 07:14

2 Answers2

2

I'd have to guess that your OPC UA server is misconfigured and returning 172.17.0.2 in its EndpointDescriptions instead of 10.0.75.1.

This either needs to be fixed in the Camel/Milo integration, if there's not already an option to override the hostname, or you would need to correctly configure the server to include 10.0.75.1 in its endpoints.

Kevin Herron
  • 6,500
  • 3
  • 26
  • 35
  • I've tried multiple servers. At least one of the servers returns the correct IP in its endpoint description, but I still cannot connect. So that's likely not the problem. – Necrophades Mar 22 '19 at 13:12
  • 1
    The timeout is occurring at the network/TCP level, so start looking there first, then. A firewall maybe? – Kevin Herron Mar 22 '19 at 23:17
1

The solution for this for my case is appending "&overrideHost=true" to the uri of the opc-ua server. It should look like this:

public class MyRouteBuilder extends RouteBuilder {
    public void configure() {
        from("milo-client:tcp://10.0.75.1:4840&overrideHost=true")
            .log("From OPC UA: ${body}");
    }
}

It really does look like the server endpoints aren't properly configured on any server that I've tried lol

Necrophades
  • 605
  • 7
  • 21