Results 1 to 4 of 4
  1. #1

    Java Clent: How to pass headers (custom app info)

    Hello,

    I have a Java client and I need to pass some custom http header(s) while connecting the client.
    (which I intend to use in LSS-meta/notifyUser method to meet some requirements.
    LSS meta adapter method: notifyUser( String, String, Map) )

    Could you please guide/advise me => how to do this in java client.
    Somehow I am not able to find a way do so in java client.
    (I can very well send the headers using curl(http) connection)

    Your help is very much appreciated.

    Regards,
    Digambar

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hi Digambar,

    If your requirement is to send custom information from clients to the Adapters the common way is to use the sendMessage method.
    But I confirm that, if your extra information is required by the authentication process, then you cannot use sendMessage.

    In general, we don't suggest using cookies for authentication purposes, because they are not under the full control of the application.
    As an alternative, any extra information could, for instance, be passed by decorating the user name in such a way that notifyUser can identify and separate the various parts.

    That said, you can pass information by setting cookies. Cookie management can be enabled on the java APIs at a global level, through the CookieHandler class. We tested that for Java SE in a different context. Hence, you should be able to perform all the cookie management needed at application level, outside Lightstreamer library.

    Hope that helps.
    Giuseppe

  3. #3

    Follow up: Java Clent: How to pass headers (custom app info)

    Hello Giuseppe

    Thanks for the info.
    But, I still don't know if I can pass the headers through Java Client or Not?

    Basically what I want to achieve is something like below (only java client is left to do so):
    .................................................. ...............................................
    [lss@localhost curl]$
    [lss@localhost curl]$ curl -H 'ClntType:GroupId' -H 'Clntvalue:f583d89a-4d6d-4c23-aa43-86ad03575dc5' -H 'AppClnt:E8341CF2DE42488392A1E8B7411F5C2C' -H 'IPAddress:10.70.225.123' -H 'RequestDate:2013-08-06T09:22:17.624393' http://localhost:8080/lightstreamer/...r&LS_user=X001
    [2] 21257
    [lss@localhost curl]$ OK
    SessionId:S2a2d207f5f8123e4T5630130
    KeepaliveMillis:5000
    MaxBandwidth:0.0

    PROBE
    PROBE
    -----------------------------------------------------------------------------------------------------

    Is that possible through/using Java client ?
    If yes, I would like to know: how to do so.
    If not, I would use the suggested alternatives (info provided earlier).

    Please let me know.

    Regards,
    Digambar



    Quote Originally Posted by giuseppe.corti View Post
    Hi Digambar,

    If your requirement is to send custom information................................

    Hope that helps.
    Giuseppe

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hello Digambar,

    I'm sorry for the misunderstanding.

    I confirm you that it is not possible to send custom HTTP headers by the Lightstreamer Java Client library, which is why I have proposed alternative solutions.

    Regards,
    Giuseppe

 

 

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 01:58 PM.