All SuperChannel components forces Message.ClientID value

Hello,

I would like to ask you to explain a bit strange behavior of all transport channels, derived from TROBaseSuperChannel…

procedure TROBaseSuperChannel.BeforeDispatch(aMessage: IROMessage);
...
begin
  try
    inherited;
    if (aMessage <> nil) and IsEqualGUID(ClientID, EmptyGUID) then
      ClientID := aMessage.ClientID;
    ...
    if aMessage <> nil then aMessage.ClientID := ClientID;
  except
    ...
  end;
end;

When first server call over such channel is dispatched, value of Message.ClientID is stored and subsequently used for ALL following calls… WHY?

Thanks, regards from Prague
Jaroslav

it’s required for proper working of super channels.

Hi Evgeny,

thanks for response. Its a bit limiting… in some cases I need to use more than one TRORemoteService, all of them has its own dedicated BinMessage component, but all of them shares one SuperChannel. In my client/server model its important to recognize & separate calls from different TRORemoteService instances, using BinMessage.ClientID seems as simple and clever way, but… forced value unification inside of SuperChannel destroys such idea in a second… :smiley:

What technique You can recommend as an alternative to realize such behavior?

Regards from Prague,
Jaroslav

why you can’t change super_tcp_channel.ClientID or super_http_channel.SessionID property before sending request to new service?
so your code will looks something like

  channel.Active := False;
  channel.ClientID := BinMessage.ClientID;
  (RORemoteService as INewService).Sum(1,2)

Hi Evgeny,

thanks for reply… Im pretty sure I cannot manually set SuperChannel.Active/ClientID properties before call is processed. In my scenario, TRORemoteService is used as low level communication component for TDARemoteDataAdapter… so every remote calls are invoked automatically, without another code interaction. As I discovered, there is no suitable event in [DataAdapter - RemoteService - BinMessage - SuperChannel] component chain, which could be used to handle this automatically.

So, I think the best and the only one solution to ensure such behavior is use separate [SuperChannel - BinMessage] component pair for every TRORemoteService.

Btw, what exactly (or more closely, at least) means the “proper working of super channels” mentioned in Your first reply? Is it someting related to active events handling/delivering?

Thanks, regards from Prague
Jaroslav

You can use simplified RDA setup, like

  lRemoteDataAdapter.DataServiceName := 'DataService';
  lRemoteDataAdapter.LoginServiceName := 'LoginService';
  lRemoteDataAdapter.LoginString := 'User Id="simple";Password="simple"';
  lRemoteDataAdapter.TargetURL := 'supertcp://localhost:8095/bin';

in this case, all required components will be created automatically inside RDA by demand.

yes, it was the issue with receiving events.

Hi Evgeny

thanks again, have nice day.

Regards from Prague,
Jaroslav