locked
MSMQ and socket programming in web RRS feed

  • Question

  • User-1291826984 posted

    Hello,

    I am working on live trading system, in this web system i have to show live data so i am calling my store procedure for bind my data. I have few questions -

    Is it possible to use MSMQ in web ?
    Is it possible to use socket programming in web ?

    Its because i am calling SP in every 5 seconds and its very lengthy. I want to use socket programming or MSMQ in LIVE trading system because if any thing update or modify in tables then only web page get notification from MSMQ or Socket and i will bind my page then only.

    And if possible then its secure and perfect for web live environment ?

    Can you please give me some link or samples of msmq and socket programming ?

    Thanks in advance.


    Friday, December 31, 2010 4:54 AM

All replies

  • User541108374 posted

    Hi,

    in your situation I would rather opt for either using ajax or a Silverlight application. Both with calling WCF endpoints which exposes your data.

    You can't call from within your browser towards an MSMQ queue directly.

    Grz, Kris.

    Friday, December 31, 2010 4:58 AM
  • User-1291826984 posted

    Hi,

    Thanks for reply. If i use wcf then again i have to call everytime wcf and it again increase no. of request. I want like that some one send request to web page and then web page take action base on that. Like socket and msmq are examples. Means i not want to call in every 5 seconds my store procedure. So my web page will wait and if page found something then web page will take action.

    Friday, December 31, 2010 5:25 AM
  • User541108374 posted

    Hi,

    your browser itself needs something to initiate the call (ajax for example) and WCF is the middle layer between your backend logic and your browser and is simply a way of transport.

    Means i not want to call in every 5 seconds my store procedure

    I suggest you make use of the Cache object and have it triggered by your SQL database to update itself (there are enough tutorials on this on google/MSDN). Also keep in session or cache if it got updated. Every 5 seconds you use ajax to query this status. If it has changed you can make an additional call to your Cache which got updated by SQL server with the latest data.

    Why the second call you might wonder? Well requesting a simple status (true/false) gives way less overhead than grabbing a full blown json object with potentially lots of data over the wire. 

    Making use of the Cache object makes sure your information's in memory and closest as possible to the browser of the enduser. Having it updated by the database only when some new data is available gives also way less overhead on the database itself.

    Grz, Kris.

    Friday, December 31, 2010 5:33 AM
  • User-1291826984 posted

    Hi,

    I want same thing as you mentioned in previous mail  "Having it updated by the database only when some new data is available gives also way less overhead on the database itself." , if possible then can you please send me small example or link for implement this. This is will be very useful for me. I have no idea about that.

    Friday, December 31, 2010 6:20 AM
  • User541108374 posted

    Hi,

    take a look at this article: Using SQL Cache dependencies.

    Grz; Kris.

    Friday, December 31, 2010 7:25 AM
  • User-1291826984 posted

    Hi,

    Its nice example but its example based on sql pooling, i have to implement sql notification. Because if any data changed in table then my code will get notify from sql and i will bind updated data.

    Friday, January 7, 2011 4:00 AM
  • User-1291826984 posted

    Anyone has any idea on this ?

    Wednesday, January 12, 2011 1:53 AM
  • User-1381043622 posted

    Hi,

    Sorry for late reply. One of my friends worked on it. You can contact him at muhammadfaisal001@hotmail.com.

    Thanks,

    Pervaiz Iqbal Khan.


    Wednesday, January 19, 2011 8:57 AM