Results 1 to 10 of 13

Hybrid View

  1. #1
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    This client name will be more than 100. like lmxtrade, kkvtrade, svg, sln etc.

    For this only i'm thinking how to use this in this case. I'm storing this client name in redis. So I can get array of clients in LS server. Can I check itemName.startsWith array of item.

    Now I have client list as ["lmxtrade", "kkvtrade", "vb", "lmx", "svg", "kb", "sln"]

    List<String> list = myFeed.getClientsList();
    for (int i = 0; i < list.size(); i++) {
    if (itemName.startsWith(list.get(i))) {
    myFeed.sendRates(itemName);
    }
    }
    I have written the subscription logic as like this, is this okay to subscribe client with LS server.

    In previously I have given OnUpdate, OnAdd and OnDelete static name as "Item"
    private void onUpdate(Object handle, String key, ClientsRateRow rates) {
    // An update was received from the feed
    // Check for late calls
    // if (isSubscribed(handle)) {
    // Create a new HashMap instance that will represent the update
    HashMap<String, String> update = new HashMap<String, String>();
    // We have to set the key
    update.put("key", key);
    // The UPDATE command
    update.put("command", "UPDATE");
    // And the new quantity value


    update.put("desc", rates.getCom_name());
    update.put("bid", rates.getBuying_rate());
    update.put("ask", rates.getSelling_rate());
    update.put("low", rates.getLow_rate());
    update.put("high", rates.getHigh_rate());
    update.put("delivery", rates.getDelivery());
    update.put("retail_rate", rates.getRetail_rate());
    update.put("comweight", rates.getCom_weight());
    update.put("comid", rates.getCom_id());
    update.put("order", rates.getCom_order());


    // Pass everything to the kernel
    // listener.smartUpdate(handle, update, false);
    listener.update("Item", update, false);
    // }
    }
    Whether I have to change Instead of Item I need to change anything. Please help me on this struggling from last week.
    Last edited by rvkvino; July 6th, 2020 at 09:06 AM.

 

 

Similar Threads

  1. how many server adapter are created?
    By josephpanchal in forum General
    Replies: 1
    Last Post: October 21st, 2019, 09:35 AM
  2. Creating adapter for dynamic stock list
    By rvkvino in forum General
    Replies: 1
    Last Post: February 14th, 2017, 09:22 AM
  3. how many server adapter are created?
    By brunovaghi in forum General
    Replies: 1
    Last Post: September 30th, 2016, 08:58 AM
  4. Snapshot in Remote Data Adapter
    By Dejan Milosevic in forum Adapter SDKs
    Replies: 5
    Last Post: July 31st, 2014, 03:06 PM
  5. Add dynamic data in Server and update it to Client
    By giangum in forum Client SDKs
    Replies: 1
    Last Post: September 1st, 2009, 09:20 AM

Tags for this Thread

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 10:33 AM.