<div dir="ltr">Hi,<br><br>In my application I need to stream stock prices to users.<br>The 'last price' will be retrieved from a separate service when a consumer connects which simplifies things.<br>Each user will subscribe to several stocks.<br>
Users are web browsers connecting using long-polling.<br><br>Do I create one queue per consumer with several bindings, one for each stock? <br>Prices in this case will be sent with a topic routing key.<br>Another option is to create one queue per stock. each consumer will be subscribed to several queues.<br>
Messages will be sent with a direct routing key.<br><br>Users will connect using a browser with long-polling to the mochiweb plugin.<br>Each user will be presented at the server side as an erlang AMQP client.<br>When using long-polling it is possible that the server sent responses to both connections and have to wait for the user to send a new request.<br>
How do I handle this scenario? Does the erlang client store the messages in its state?<br>Every time the erlang client gets a new long-polling request it checks for messages in the state,<br>if there are messages it sends them immediately and if there aren't it keep-alive the request.<br>
Another option is that the erlang client will acknowledge messages only if it can pass it to the web client.<br>What will happen in this case? Will the queue keep sending new messages or will it wait for the erlang client o 'initialize' the channel?<br>
Are there a suspend and resume features?<br><br>Thanks<br></div>