# All SuperChannel components forces Message.ClientID value

**URL:** https://talk.remobjects.com/t/all-superchannel-components-forces-message-clientid-value/7548
**Category:** Remoting SDK
**Tags:** delphi
**Created:** [November 20, 2015, 1:24pm UTC](https://talk.remobjects.com/t/all-superchannel-components-forces-message-clientid-value/7548 "2015-11-20T13:24:54Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![callida](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/c/8edcca/32.png) [@callida](https://talk.remobjects.com/u/callida)
#### Post date: [November 20, 2015, 1:24pm UTC](https://talk.remobjects.com/t/all-superchannel-components-forces-message-clientid-value/7548/1 "2015-11-20T13:24:54Z")

</div>

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

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [November 22, 2015, 4:10pm UTC](https://talk.remobjects.com/t/all-superchannel-components-forces-message-clientid-value/7548/2 "2015-11-22T16:10:18Z")

</div>

it’s required for proper working of super channels.

---

<div class="post-metadata">

### Author: ![callida](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/c/8edcca/32.png) [@callida](https://talk.remobjects.com/u/callida)
#### Post date: [November 30, 2015, 1:57pm UTC](https://talk.remobjects.com/t/all-superchannel-components-forces-message-clientid-value/7548/3 "2015-11-30T13:57:57Z")

</div>

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… 😃

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

Regards from Prague,  
Jaroslav

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [November 30, 2015, 2:36pm UTC](https://talk.remobjects.com/t/all-superchannel-components-forces-message-clientid-value/7548/4 "2015-11-30T14:36:11Z")

</div>

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

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

```

---

<div class="post-metadata">

### Author: ![callida](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/c/8edcca/32.png) [@callida](https://talk.remobjects.com/u/callida)
#### Post date: [November 30, 2015, 3:00pm UTC](https://talk.remobjects.com/t/all-superchannel-components-forces-message-clientid-value/7548/5 "2015-11-30T15:00:05Z")

</div>

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

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [November 30, 2015, 3:21pm UTC](https://talk.remobjects.com/t/all-superchannel-components-forces-message-clientid-value/7548/6 "2015-11-30T15:21:08Z")

</div>

> [@callida](#):
>
> 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.

You can use simplified RDA setup, like

```auto
  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.

> [@callida](#):
>
> 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?

yes, it was the issue with receiving events.

---

<div class="post-metadata">

### Author: ![callida](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/c/8edcca/32.png) [@callida](https://talk.remobjects.com/u/callida)
#### Post date: [November 30, 2015, 3:29pm UTC](https://talk.remobjects.com/t/all-superchannel-components-forces-message-clientid-value/7548/7 "2015-11-30T15:29:55Z")

</div>

Hi Evgeny

thanks again, have nice day.

Regards from Prague,  
Jaroslav
