Archived

This forum has been archived. Please start a new discussion on GitHub.

A question about CallbackAdapter.Router

Suppose there is a Client(IP:1.2.3.4)/Server(IP: 10.0.0.1) system which uses a Glacier2(IP: 5.6.7.8/10.0.0.2) to handle firewall issues. Further, the Client provide callbacks, so the Client has to make configuration as follows:
Ice.Default.Router=Glacier2/router:tcp -h 5.6.7.8 -p 10005
CallbackObjectAdapter.Router=Glacier2/router:tcp -h 5.6.7.8 -p 10005

I have read Chapter 39.4.4 of Ice manual(2.1.1). However, I can not figure out why we have to use two different config items to use callbacks. I think, most of time (or all of time), these two config items should have the same value(Glacier2/router:tcp -h 5.6.7.8 -p 10005).

Thank you!

Comments

  • marc
    marc Florida
    Ice.Default.Router is only for the client side (i.e., outgoing requests) of your application. The server-side router information (i.e., for incoming requests) must be set separately for each per object adapter.
  • I am sorry, I still can not understand although I have read this part in Ice manula once again.

    According to Figure 39.6, there are 4 steps to make a callback connection in Glacier2. However, step1 and step4 always use the same connection, so when they(these two config items) have different value ?
  • marc
    marc Florida
    If you would use multiple Glacier2 routers (i.e., if your client would receive callbacks from different servers, using different Glacier2 routers), then you would have to use multiple object adapters with different router configurations.

    In this case, Ice.Default.Router would only be useful if for outgoing requests, you have one "default" server. For servers other than the default server, you would have to set the router on a per-proxy basis, i.e., with the proxy's ice_router() operation.
  • If there is just a Client and Server, we can use different Glacier2 routers as follows?
    Client --step1--> Glacier2 routerA --step2---> Server
      ^                                              |
      |                                              |
      |                                              |
      |                                              |
      ---step4-------Glacier2 routerB<----step3-------
    
  • I am puzzled by this sentence in Ice manual 2.1.1, page 1129:
    The router forwards the callback request to the client using the bi-directional connection established in step 1.  
    
  • marc
    marc Florida
    Sorry, I don't understand the question. Why would you want to use multiple Glacier2 instances if there is only one server? You only need multiple Glacier2 instances if you have different servers, running in different backend networks, both with their own separate access to the Internet. If the servers share the same access to the Internet, there is no need for multiple Glacier2 instances.

    Note that you can have multiple Glacier2 instances for load balancing, but this is an entirely different issue. In this case, you would configure one router proxy with multiple endpoints, each referring to one of the redundant Glacier2 instances. The Ice runtime would then pick one of them at random.
  • marc
    marc Florida
    rc_hz wrote:
    I am puzzled by this sentence in Ice manual 2.1.1, page 1129:
    The router forwards the callback request to the client using the bi-directional connection established in step 1.  
    

    I'm sorry, but I'm afraid I don't understand this question either. What exactly puzzles you about this sentence? Using bi-directional connections, a server sends callbacks over the connection that has been established from the client to the server, instead of trying to create a new connection from the server to the client. That's how all bi-directional connections work, if you use them with Glacier or not...
  • I have drawn a picture to reflect my understanding. Can you be so kind to have a look and point out my misunderstanding? Thank you ?
  • marc
    marc Florida
    Technically, both case 1 and case 2 work, with one exception: In case 2, you need to establish a connection from the client to server A via router B. Otherwise, there is no connection that router B could use to send callbacks to the client.

    To establish such a connection, you could create a single proxy for server A, set the router for this proxy (with ice_router()) to router B, and establish a session with this proxy with router B as usual.

    However, I don't understand the purpose of this setup. Why do you want to have two Glacier2 instances to route callbacks to your client from the same server? What's the advantage over using just one router?