View Full Version : Stock trading example
10-26-2010, 12:37 AM
Ive had a few problems with the Stock trading example in .Net.
The issue is with the
model.QueueBind("APP.STOCK.MARKETDATA", "", "", false, null);
in the initializeRabbitQueues() methods on both client and server.
It complains about ACCESS problem.
If I remove this line, then I can get the application to work, although only the request/reply part. Not the market data streams.
If I add an exchange Ive already created called "GMT" of type topc, it runs, but does not stream market data.
Could you tell me what I am doing wrong ?
10-26-2010, 06:45 PM
I will take a look at this today. I had the demo working right before the release and coincidentally last week I tried it out again and also had issues with the streaming market data. Not sure what is up. What version of the rabbit broker are you using?
10-27-2010, 12:57 AM
The latest version of rabbit: 2.1.1
Thanks for your reply. I'm really interested in using Spring AMQP .Net for a greenfield project here.
My only other concern is how to do local transactions. I saw on the java forum there is a hint it can be done on the publish side, but no example. And I see in the issue-tracking a solution has been done for the cosnsumer side for release M2....
I really need one of those, with the hope of another to get my prototype to fly.
Could you slip me a quick example of local transactions on the publish side ?
Note: I dont mean distributted tx, or transaction scope. Just TxSelect, TxCommit/TxRollback around my code, that I can semi-control.
10-27-2010, 06:29 AM
Wait i'll look at it thoroughly first and study it first.
Just wait for a while.
11-03-2010, 06:00 AM
Any progress on this Mark ?
11-05-2010, 06:26 PM
Just getting to it now...sorry for the delay...
11-09-2010, 02:09 PM
Unlike the Hello World examples where there was a separate "Spring.Amqp.HelloWorld.BrokerConfiguration" project that created the queues and exchanges. The Stock Example was doing that within the Server and Client applications themselves. This turned out to be a bad idea as the message listener container would get initialized before the queues/exchanges were declared. The quick solution is to run a seperate BrokerConfiguration project beforehand which I've attached.
This extra setup step won't be necessary once I have the RabbitAdmin class implement the ILifecycle so that it can declare all the exchanges, queues, bindings that have been delcared in the context at the right moment in the container lifecycle.
In the meantime, add in the attached project and run it before the stock app client and server programs. You should comment out the calls to "InitializeRabbitQueues" in the Program.cs of the Client and Server. You can also pull from the git repo to get the latest code.
11-14-2010, 11:51 PM
I needed to get Transactions working on the send side, so Ive had to take RabbitTemplate out of the spring code, and modify to enable a channel to be passed to it.
My current task it to do something similar on the receive side.
11-16-2010, 01:08 PM
Ok. Transactional support has been done on the Java version and I will be syncing it up so that we can do a M2 release in the coming week or so. If you would like to help in that effort, that would be great!
11-22-2010, 04:55 AM
Great news Mark.
The threethings missing from M1 .Net version that I need are:
- Client transactions.
- Receive Ack (or specifically no ack) handling. - I guess this is a way of receive "transactions".
- Implementation of the SimpleRPC blocking call.
If M2 has all those, Id be happy to help testing.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.