Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [milo-dev] Unable to connect OPC server inside DOCKER

Hi,

yes, inside docker that can be tricky. The IP inside docker is different than the IP outside of docker. however, the OPC server inside the container take the internal IP and sends that back to the client.

You can, and need to, override the IP/name of the host after discovering and connecting. Like here: https://github.com/apache/camel/blob/54a209043196b2e2b96abaf69aa31ddbc42338ad/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/internal/SubscriptionManager.java#L756-L808

Cheers

Jens

On Fri, Jun 3, 2022 at 2:52 PM Pankaj Mishra <pankaj.mishraa06@xxxxxxxxx> wrote:
Hello,
My name is Pankaj and I am a developer at Siemens.
I am facing this issue described below.

My Client:

Container name:  opcmockmiddleware-opcserver-1 (This is opcserver container name)

I am trying to connect OPC server from client using the code:
List<EndpointDescription> endpoints = DiscoveryClient.getEndpoints(url).get();
The URL which I have configured is like
opc.server.url=opc.tcp://opcmockmiddleware-opcserver-1:4850/siemens
on my client so that it can discover the server.
But for some reason it is creating a wrong url while calling the opc server .
Please find the below screenshot.
image.png

I have also tried by hardcoding the IP to connect to server but its shows 
connection refused:  /172.31.0.2:4850

It is malfunctioning the URL , when both client and server is running inside docker .
Eclipse milo version:
Client: 0.6.4
server: 0.4.3

Please help!. I am stuck here.
I will be waiting for your reply.

Thanks,
Pankaj.
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/milo-dev


--
Jens Reimann
Principal Software Engineer / R&D Product Middleware
Werner-von-Siemens-Ring 14
85630 Grasbrunn
Germany
phone: +49 89 2050 71286
_____________________________________________________________________________

Red Hat GmbH, Registered seat: Werner von Siemens Ring 14, D-85630 Grasbrunn, Germany
Commercial register: Amtsgericht Muenchen/Munich, HRB 153243,
Managing Directors: Ryan Barnhart, Charles Cachera, Michael O'Neill, Amy Ross

Back to the top