How QuickFixJ submits order to an exchange - quickfixj

In the QuickFixJ source code, which class/method is responsible for actually sending a trade order to the exchange?

Have a look in the quickfix.Session class. This method is used to send all messages (not just trades).

Related

Add reaction to existing posts or comments

How can we "like" or add other reactions to someone else's channel message or comment via the Graph API?
I've not done this myself, but it certainly looks possible. You need to reply to the message, as per https://learn.microsoft.com/en-us/graph/api/channel-post-messagereply?view=graph-rest-1.0&tabs=http and notice that it has a "reactions" collection. That would be populated with a chatMessageReaction type, as per https://learn.microsoft.com/en-us/graph/api/resources/chatmessagereaction?view=graph-rest-beta
Note of warning: chatMessageReaction is a beta type though, so just be aware you need to call the beta endpoint, and it has a risk to use in production code as things might change.
Update: We reached out to MS Support and received the following info: "The API to reply to a message using a POST /replies request is solemnly for issuing a reply to a message, and not to edit the status of the parent message itself. Moreover, the "update chatMessage" API which is a PATCH /messages and which is the only API to edit a parent message only supports updating the policyViolation property of a chatMessage. Essentially, there is currently no documented API / already-present API examples on how to add a reaction, making this purely unsupported."

Difference between register_interceptor and after_actions in rails

I am using rails 5 along with Amazon SES.
I wanted to throttle emails before sending them because SES isn't able to handle bulk emails in a short span and mail jobs are failing.
So I wanted to add a sidekiq worker with rate limiting.
From where should I call the worker, mail_interceptor or after_actions.
PS. In general what is the difference between them?
There is vast difference.
mail_interceptor
When using an ActionMailer in Rails, there is a way to hook into an outbound message after calling "Deliver" method, but before delivery agents actually send it. You can think of these interceptors in the controller as before_action filter.
If you need to do any sort of modification before actually deliver, you will need to use an Interceptor.
after_action
This is a callback for controllers, use for perform something after completion of method or action.
Please refer this for more understanding.
The Problem
Based on my understanding of your question, the problem here is a low level design question of where to place the code to throttle and send emails.
Difference between after_action and mail_interceptor as per my understanding
The use case of after_action,fairly straight forward, is to do something after certain action is executed.
The mail_interceptor on the other hand, is a hook that can be added in action mailer's mail delivery life cycle. As I understand, the purpose of the interceptor, is to modify certain email content or restrict sending email to users or restricting sending emails in certain environment before handling to the delivery agent. The use case is more concerned with whether to send or what to send or to whom to send rather than how to send.
Where to place the code?
Also, the interceptor gets called on all email deliveries, since it is hooked to the life cycle of . For example, in case of a reset password email, I am assuming there is no necessity to throttle and is not necessary to call this piece of code.
Based on the above assumptions and understanding, my opinion is placing the code to throttle emails in the after_action makes more sense than placing it in the mail_interceptor.
Hope this was helpful!

user notifications in Grails

I'm building an application using Grails 2.5.1 , i want to implement a user's notification service ,similar as Stack overflow for instance when the user has unread messages it notifies the user as soon as he login . is there a plugin or a handy way to achieve this ?
thanks
If you want some data (ex: unread messages) on demand (login), then you could include this in the action's returned map or fetch the data from a separate Ajax call when the document.event fires and manipulate the DOM (easily done through jquery, angular, etc.)
If you are looking to update the DOM asynchronously based on events that happen server-side (another user sends a message and you would like to 'instantly' alert the current user), then things become more complicated.
Spring Websocket
There is a grails plugin that we have experimented with and have had success with: grails-spring-websocket. Check out the link for examples and more info.
There is a bean brokerMessagingTemplate that is injected within your service class that has methods to publish a message. On the client, you subscribe to the corresponding message url using javascript. When the callback function is executed, a message has been published - manipulate the DOM as needed.
There are also some controller annotations provided by the plugin, but I don't have experience with them.

iOS REST design pattern advice

I’d like some input on whether there is a better design pattern to use for my iOS app, which uses a REST model to communicate asynchronously with a Django back end.
The server can presently return three types of responses to requests:
a JSON object
a server status code integer
a long Django error message
When an action is performed in the iOS app that requires data from the server, my design pattern looks like this:
An observer is added to notification center, specifying a method that can process the server response
The method puts together and sends a NSURLConnection
A NSURLConnection delegate method receives the response, does some interpretation to check what kind of server response it is, and then posts the appropriate notification to the notification center
This triggers the response method to run, processing the response
My issue with this pattern is that there are a large number of methods written to send and receive individual request and response types. For instance, if I am requesting an item list, I need to add several observers to the notification center, one to process a user list, one to process a blank user list, and one to process errors. Then I need to write custom methods for each one of those three to perform the appropriate actions and remove the observers, based on what kind of response the server sends.
Furthermore, the NSURLConnection delegate ends up being fairly complex, because I’m trying to interpret what type of a response was received (what types of items were in the list received?) without much context of what was requested, to make sure I don’t call the wrong response method when a server message comes back.
I am fairly new to both iOS programming and to REST programming, so I may be missing something obvious. Any advice or links to resources is appreciated.
I'd initially look at using RestKit to abstract your code away from the network comms so you can worry more about the data model and high level requests. Secondly, I wouldn't use notifications for this as it will likely get messy and be very hard to manage multiple simultaneous requests - delegation or block callbacks will be much better for this.
Your REST implementation is mostly server side, and emprirically you'd be passing and receiving binary. There are factors to consider, including whether you are utilizing HTTP.
Working with JSON with NSJSONSerialization class, and NSURLConnection keeps your program more lean and mean.

Asyncronously send messages to third party systems - queue?

We have an ASP.NET MVC web app which allows users to publish messages onto a web site. Alongside this, the user is also able to syndicate that message content to other 3rd party systems when they post the message.
At present, this is done synchronously, so when they click the 'Post' button, we persist their message to the database and then notify each 3rd party systems in turn. We need to improve the scalability and durability of this operation so I would like to make the notification aspect of the action asynchronous in some way.
I can think of the following possiblities
Save the 3rd party messages into a database table and have some worker process read items from the table and post to the 3rd party systems.
Use a "proper" message queue of some sort like nServiceBus or RabbitMQ (I have no experience with either of these)
Is there a better way to do this? I'm particularly interested in how to notify the user that the message has been syndicated correctly (since it's ansynchronous) and also how to handle multiple retry failures, at which point the sender should just give up.
Thanks
James
NServiceBus is a great framework for implementing asynchronous communication. If you use it for this use case, you will see many other opportunities for applying messaging for improving the scalability and reliability of your system.
Create a MessagePosted event message that is published after a message is persisted to the database. For each third party system that might be notified of the message, create an event handler class that implements IHandleMessages.
Multiple retry failures is facilitated by NServiceBus, just throw an exception within the event handler if something goes wrong. The event will be resubmitted to the event handler for a configurable number of retries before the event is moved to the error queue.
To notify the user you can for instance create a status view or widget which shows the notification results of the latest messages. If a third party system cannot be notified you can consider sending the user an e-mail so that he can take action.
Use this publish subscribe sample to get up to speed quickly: http://docs.particular.net/samples/pubsub/
You should read this: It explains how to use pub sub with RabbitMQ http://www.rabbitmq.com/tutorials/tutorial-three-java.html

Resources