Results 1 to 7 of 7
  1. #1

    Trouble investigating ARI adapters via docker-compose [.NET]

    Hello!

    I'm checking if Lightstreamer will work for my organization, but I'm running into problems

    I've been attempting to get Lightstreamer and a .NET-based remote adapter set (one metadata + one data) working together in a set of containers on my machine via docker-compose, however the Lightstreamer server appears to be rejecting connections from the remote adapters.

    Here's my docker-compose file. I'm confident that the compose file is correct-- I'm really just providing it as a concise way to describe the containers at play:

    Code:
    version: "3"
    services:
      daemon:
        image: lightstreamer
        ports:
          - "8080:8080"
      authentication:
        build: authentication
        environment:
          - LS_HOST=daemon
          - LS_PORT_REQREP=9001
          - LS_PORT_NOFITY=9002
        links:
          - daemon
      dummydata:
        build: dummydata
        environment:
          - LS_HOST=daemon
          - LS_PORT_REQREP=9011
          - LS_PORT_NOFITY=9012
        links:
          - daemon
    authentication and dummydata are modeled closely after the example .NET ARI adapter on GitHub (https://github.com/Lightstreamer/Lig...adapter-dotnet). The metadata adapter server, as implied by the compose file, attempts to connect to Lightstreamer over port 9001 for requests and replies. The data adapter, similarly, attempts to connect to Lightstreamer on ports 9011 (request-response) and 9012 (notify).

    I left lightstreamer_conf.xml untouched, and created a new adapter config, adapters/dummydata/adapters.xml:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Do not remove this line. File tag: adapters_conf-APV-20200124. -->
    
    <adapters_conf id="PROXY_SOCKET_ROBUST">
    
        <metadata_adapter_initialised_first>N</metadata_adapter_initialised_first>
        <metadata_provider>
            <install_dir>metadata</install_dir>
            <adapter_class>ROBUST_PROXY_FOR_REMOTE_ADAPTER</adapter_class>
            <classloader>log-enabled</classloader>
            <param name="request_reply_port">9001</param>
            <param name="interface">authentication</param>
            <param name="auth">N</param>
            <param name="connection_recovery_timeout_millis">10000</param>
            <param name="first_connection_timeout_millis">10000</param>
            <param name="close_notifications_recovery">unneeded</param>
            <param name="notify_user_disconnection_code">-10</param>
            <param name="notify_user_disconnection_msg">Remote Metadata Adapter unavailable</param>
        </metadata_provider>
    
    
        <data_provider name="MY_REMOTE">
            <install_dir>myadapter_one</install_dir>
            <adapter_class>ROBUST_PROXY_FOR_REMOTE_ADAPTER</adapter_class>
            <classloader>log-enabled</classloader>
            <param name="request_reply_port">9011</param>
            <param name="notify_port">9012</param>
            <param name="interface">dummydata</param>
            <param name="tls.remove_cipher_suites.1">_DHE_</param>
            <param name="tls.enforce_server_cipher_suite_preference">Y</param>
            <param name="tls.enforce_server_cipher_suite_preference.order">JVM</param>
            <param name="tls.allow_protocol.1">TLSv1.2</param>
            <param name="auth">N</param>
            <param name="connection_recovery_timeout_millis">10000</param>
            <param name="first_connection_timeout_millis">10000</param>
            <param name="events_recovery">use_snapshot</param>
            <param name="status_item">remote_adapter_status</param>
            <param name="missing_connection_timeout_millis">10000</param>
        </data_provider>
    
    </adapters_conf>
    After all this, when I run docker-compose up I get a .NET error message from both of my adapters saying that Lightstreamer has refused to connect. Here you can see that my adapter resolved daemon as 172.23.0.2:

    Code:
    dummydata_1       | System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (111): Connection refused 172.23.0.2:9011
    dummydata_1       |    at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
    dummydata_1       |    at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
    dummydata_1       |    at System.Net.Sockets.Socket.Connect(IPAddress address, Int32 port)
    dummydata_1       |    at System.Net.Sockets.TcpClient.Connect(String hostname, Int32 port)
    dummydata_1       | --- End of stack trace from previous location where exception was thrown ---
    dummydata_1       |    at System.Net.Sockets.TcpClient.Connect(String hostname, Int32 port)
    dummydata_1       |    at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port)
    dummydata_1       |    at LightstreamerDummyDataProvider.Program.AttempTcpClient(String host, Int32 port) in /src/LightstreamerDummyDataProvider/LightstreamerDummyDataProvider/Program.cs:line 31
    I've written my adapters to try for a good 15 seconds or so to connect to the Lightstreamer daemon, so I'm confident this isn't happening because Lightstreamer just isn't ready to receive connections yet.

    I double-checked that my networking assumptions about docker-compose were correct, and they are-- when I added an httpd-based service called "web" to the services, my remote adapters were able to connect to it as http://web:80 without issue. I also verified that my adapters were able to resolve "daemon" as an IP, which I confirmed they were. This all leads me to believe that Lightstreamer is responsible for rejecting my adapters. I followed the ARI documentation all the way through, however I feel like there's just some additional configuration I'm missing, or that perhaps there's something about docker-compose that messes with Lightstreamer. If it would help, I can provide my repo as a runnable example.

    I figured maybe I'd have more luck running Lightstreamer and the remote adapters non-virtualized, just as vanilla processes on my local machine speaking to each other, however running Lightstreamer outside of a container on Windows is also giving me an error citing an unreadable path (it doesn't say which path is the problem). It says to check the logs for more info on what when wrong, but then I look in the logs directory and it's empty. At this point I figured it was time to reach out for help.

    Any and all help would be appreciated. Thanks!

  2. #2
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    159
    Hi alexarendsen,

    thank you for your very detailed information!
    Yes, it would be helpful to have your repo as a runnable example. Please let us know how we can access it.

    Best,
    Gianluca

  3. #3
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    159
    Hi alexarendsen,

    could you please remove the "interface" parameter from the adapters.xml and try again? We think that such a parameter should not be specified in this case.

    Best,
    Gianluca

  4. #4
    Hi Gianluca, thanks again for the response and sorry for taking so long to get back.

    After removing the "interface" param and tweaking a few others, I came up with this config, which has resulted in (apparent) success! I've commented out the removed sections for clarity on what I removed / changed. I'll probably be adding some of these back in, but for now this appears to have gotten me rolling:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Do not remove this line. File tag: adapters_conf-APV-20200124. -->
    
    <adapters_conf id="PROXY_SOCKET_ROBUST">
    
        <!-- Updated this value from Y to N -->
        <metadata_adapter_initialised_first>N</metadata_adapter_initialised_first>
    
        <metadata_provider name="REMOTE_AUTH">
            <!-- <install_dir></install_dir> -->
            <adapter_class>ROBUST_PROXY_FOR_REMOTE_ADAPTER</adapter_class>
            <classloader>log-enabled</classloader>
            <param name="request_reply_port">9001</param>
            <!-- <param name="interface">authentication</param> -->
            <!-- <param name="auth">N</param> -->
            <param name="connection_recovery_timeout_millis">1000</param>
            <param name="first_connection_timeout_millis">1000</param>
            <param name="close_notifications_recovery">unneeded</param>
            <param name="notify_user_disconnection_code">-10</param>
            <param name="notify_user_disconnection_msg">Remote Metadata Adapter unavailable</param>
        </metadata_provider>
    
        <data_provider name="REMOTE_DUMMY_DATA">
            <!-- <install_dir></install_dir> -->
            <adapter_class>ROBUST_PROXY_FOR_REMOTE_ADAPTER</adapter_class>
            <classloader>log-enabled</classloader>
            <param name="request_reply_port">9011</param>
            <param name="notify_port">9012</param>
            <!-- <param name="interface">dummydata</param> -->
            <!--
              <param name="tls.remove_cipher_suites.1">_DHE_</param>
              <param name="tls.enforce_server_cipher_suite_preference">Y</param>
              <param name="tls.enforce_server_cipher_suite_preference.order">JVM</param>
              <param name="tls.allow_protocol.1">TLSv1.2</param>
            -->
            <!-- <param name="auth">N</param> -->
            <param name="connection_recovery_timeout_millis">1000</param>
            <param name="first_connection_timeout_millis">1000</param>
            <!-- <param name="events_recovery">use_snapshot</param> -->
            <param name="events_recovery">enforce_snapshot</param>
            <param name="status_item">remote_adapter_status</param>
            <!-- <param name="missing_connection_timeout_millis">1000</param> -->
        </data_provider>
    
    </adapters_conf>

  5. #5
    Oh! And one last thing-- I removed the part of my metadata adapter that was trying to connect a NotifyStream (connecting to the daemon on port 9002). As far as I can tell, only DataAdapters need a NotifyStream in addition to the Request + Reply Streams; MetadataAdapters only need the latter.

  6. #6
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    159
    Quote Originally Posted by alexarendsen View Post
    Oh! And one last thing-- I removed the part of my metadata adapter that was trying to connect a NotifyStream (connecting to the daemon on port 9002). As far as I can tell, only DataAdapters need a NotifyStream in addition to the Request + Reply Streams; MetadataAdapters only need the latter.
    Hi Alex,

    yes, it is correct.

    Best,
    Gianluca

  7. #7
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    159
    Quote Originally Posted by alexarendsen View Post
    Hi Gianluca, thanks again for the response and sorry for taking so long to get back.

    After removing the "interface" param and tweaking a few others, I came up with this config, which has resulted in (apparent) success! I've commented out the removed sections for clarity on what I removed / changed. I'll probably be adding some of these back in, but for now this appears to have gotten me rolling:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Do not remove this line. File tag: adapters_conf-APV-20200124. -->
    
    <adapters_conf id="PROXY_SOCKET_ROBUST">
    
        <!-- Updated this value from Y to N -->
        <metadata_adapter_initialised_first>N</metadata_adapter_initialised_first>
    
        <metadata_provider name="REMOTE_AUTH">
            <!-- <install_dir></install_dir> -->
            <adapter_class>ROBUST_PROXY_FOR_REMOTE_ADAPTER</adapter_class>
            <classloader>log-enabled</classloader>
            <param name="request_reply_port">9001</param>
            <!-- <param name="interface">authentication</param> -->
            <!-- <param name="auth">N</param> -->
            <param name="connection_recovery_timeout_millis">1000</param>
            <param name="first_connection_timeout_millis">1000</param>
            <param name="close_notifications_recovery">unneeded</param>
            <param name="notify_user_disconnection_code">-10</param>
            <param name="notify_user_disconnection_msg">Remote Metadata Adapter unavailable</param>
        </metadata_provider>
    
        <data_provider name="REMOTE_DUMMY_DATA">
            <!-- <install_dir></install_dir> -->
            <adapter_class>ROBUST_PROXY_FOR_REMOTE_ADAPTER</adapter_class>
            <classloader>log-enabled</classloader>
            <param name="request_reply_port">9011</param>
            <param name="notify_port">9012</param>
            <!-- <param name="interface">dummydata</param> -->
            <!--
              <param name="tls.remove_cipher_suites.1">_DHE_</param>
              <param name="tls.enforce_server_cipher_suite_preference">Y</param>
              <param name="tls.enforce_server_cipher_suite_preference.order">JVM</param>
              <param name="tls.allow_protocol.1">TLSv1.2</param>
            -->
            <!-- <param name="auth">N</param> -->
            <param name="connection_recovery_timeout_millis">1000</param>
            <param name="first_connection_timeout_millis">1000</param>
            <!-- <param name="events_recovery">use_snapshot</param> -->
            <param name="events_recovery">enforce_snapshot</param>
            <param name="status_item">remote_adapter_status</param>
            <!-- <param name="missing_connection_timeout_millis">1000</param> -->
        </data_provider>
    
    </adapters_conf>
    Great!

    Gianluca

 

 

Similar Threads

  1. Some help with ARI
    By stefanx in forum Adapter SDKs
    Replies: 2
    Last Post: July 20th, 2008, 03:04 PM
  2. Trouble compiling DataAdaptor
    By lucab617 in forum Adapter SDKs
    Replies: 3
    Last Post: May 2nd, 2008, 03:43 AM
  3. ARI protocol question
    By cbcrack in forum Adapter SDKs
    Replies: 3
    Last Post: January 7th, 2008, 09:07 AM
  4. New documentation for ARI released
    By Alessandro in forum Adapter SDKs
    Replies: 2
    Last Post: July 30th, 2007, 11:29 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 11:37 PM.