Hi Sanjit,

First off, ChannelSet#login and ChannelSet#logout are the preferred ways of 
authenticating with BlazeDS/LCDS. Producer/Consumer/RemoteObject#setCredentials 
would work but the problem with setCredentials method is that it doesn't return 
an AsyncToken and hence you can't listen for success/failure. Also, 
setCredentials method does not send the credentials to the server until the 
Channel is connected, it simply caches them and sends them along with the 
connect request. The problem is if there's a failure as the Channel connects 
(eg. RemoteObject method doesn't exist) and an authentication failure too (eg. 
wrong credentials), then distinguishing between the RemoteObject failure with 
the authentication failure becomes difficult. So, that's why you should use 
ChannelSet#login/logout before doing anything else, and once the authentication 
is successful, go ahead with what you need to do. BlazeDS source tree has an 
example of this here:

http://tinyurl.com/27y2zd5

Second, the load-testing-tool in LCDS 3.1 does not support authentication or 
SSL (RTMPS, HTTPS) yet. By default, the LCDS Edge Server requires that clients 
are authenticated at the edge tier before the request is forwarded to the 
backing LCDS app. This is for security purposes but the good news is that for 
testing purposes, there's a switch called "require-authentication" which is set 
to true by default and you can set that to false under GatewayService 
configuration:

<service id="test-gateway" class="flex.messaging.services.GatewayService">
   <properties>
      <gateway-endpoint>
         <require-authentication>false</require-authentication>
   ...

That basically disables the requirement that clients are authenticated at the 
edge tier. 

This should enable you to test your Edge+LCDS app without needing to add 
authentication stuff in the load-testing-tool.

Mete Atamel
Data Services Team, Adobe Systems
http://meteatamel.wordpress.com/

--- In [email protected], "sanjitcs" <sanjit.f...@...> wrote:
>
> I am using LCDS 3.1 java based load testing tool to generate 100 concurrent 
> consumer to subscribe to the topic. 
> Since I am using edge server to communicate with application server. It dose 
> not be able to subscribe the consumer because getway service is not be able 
> to authenticate client.
> I am getting Following error.
> 
> Exception in thread "main" java.lang.RuntimeException: Consumer '0' failed to 
> subscribe:
> Flex Message (flex.messaging.messages.ErrorMessage) 
>     clientId = C06AF337-0D68-2A86-C855-8AA0BC025252
>     correlationId = D383DB46-081D-9083-A00B-81B06DD4AA31
>     destination = application_data
>     messageId = C06B06BF-0C3F-F7CF-1701-B1EA4F1FB678
>     timestamp = 1273679434799
>     timeToLive = 0
>     body = null
>     hdr(DSErrorHint) = true
>     code =  Server.Authentication
>     message =  Gateway service 'gateway-to-app' requires an authenticated 
> client. Please login before interacting with any gateway service destinations.
>     details =  null
>     rootCause =  null
>     body =  null
>     extendedData =  null
>       at javaclientexamples.LCDSDriver.doMain(LCDSDriver.java:274)
>       at javaclientexamples.LCDSDriver.main(LCDSDriver.java:131)
> 
> 
> In Flex client we are using setCredential of consumer class to set credential 
> to authenticate client.
> 
> But i am not be able to set credential for consumer in java based load 
> testing tool. Consumer /MessageAgent/ ChannelSet class does not have 
> setCredential  method. is there any way to set the credential in 
> consumer/Channel so that it can subscribe. 
> 
> Or any tool which can help me to generate 100 simultaneous user load on 
> server (edge server + application) and do load testing for messaging on  
> RTMP/RTMPS protocol.
>


Reply via email to