Get data from FIX protocol in mobile apps - java

I need to create an app which get's it's displayed data from FIX protocol in real time.
How would be best practice to accomplish this?
Should the mobile app read directly the FIX data?
Should I put a server in between to transform the FIX data to JSON or something more prepared for service consumption? And if so... how would I do it to not lose the real time? Creating a websocket in Java which for the mobile apps to call and that websocket would transform the FIX data to JSON that way?
I never worked with the FIX protocol before by the way.

So like, the question is, can you put a FIX client on a mobile phone? I guess you can, and I am sure it will happen soon.
Yes, anything can read FIX data, it's simply text stream name value pairs, where the name is a numbered tag to identify some particular financial data or process, as agreed between the FIX community as a whole, or between direct counterparties using messaging data dictionaries.
These days you could try using SBE throughout, including at the mobile client, but for now current practise is yes, to use JSON for client endpoints (where the JSON name is not a FIX tag but the underlying FIX field name so it's easier for people to understand) and pass JSON messages to the mobile device in some kind of REST data processing.
So yeah, you'd have a FIX server (if you are new to FIX try QuickFix) to connect with your provider. Then what you need between that server and mobile clients is asynchronous messaging. Consider a quote request is not a simple request / response where you can block the request thread until a single response is received, it's a request followed by a stream of many responses. So you want an event handler style to route the responses back to clients asynchronously. With many mobile UI clients making requests and receiving responses you need to demultiplex the responses from the 1 FIX server out to the many mobile clients. That's something that QuickFIX itself kind of already does using a session layer. You need to do the same using sessions or identifiers in the messages you're passing around.
Yeah I guess websockets are intended to be that solution for real time. You could write a native mobile app though, using something like node or react to handle the message events.

Related

Making a chat app with a java client and php server [duplicate]

This question already has answers here:
Making Android chat application from scratch
(6 answers)
Closed 8 years ago.
I need to send messages between two Android's running my app, with a PHP server in between. Devices are identified by phone number, but I have no clue how to send the message
I've looked into sockets and the sorts but do not really know how to work it with PHP
Anyone point me in the right direction?
I would look into the idea of RESTful apis, here is a start. Essentially what you do it have different urls that the android app can send data to. Sending data to one might make a chat between two androids and return the chat id. Then you can send data to another to send a chat message, including that chat id. The only thing you want to be careful of is security. A general rule when making a api like this is, asume people will find these urls, and asume people will use these malicously. So incorperate some sort of security, look at how other peeople do it, like Google.Another important concept in RESTful apis is the idea of http verbs. In http you can commonely, GET(What your browser does most of the time), POST, PUT, and DELETE. This allows you to have 1 url and many actions, like so
GET /users/chats - returns users chats
POST /users/chats - creates a chat
PUT /users/chats - updates a chat
DELETE /users/chats - deletes a chat
Security
Generally when I create a RESTful api I use a token secret combination. For anyone to use my API they have to send a token with it, along with a secret. If the token they send and the secret match, then they can use the api.

test connection with OData without getting any data

I was wondering, is there some way to get just the response from OData server, preferably with odata4j client, without any particular data actually being sent? I can request the server for metadata, but that's kind of wasteful, since it sends lot of data.
I want to send request and get response that would tell me if authorisation is correct and whether the server generally responds correctly, but I don't want to ask for any particular data. I know I could ask for something random, that's not very elegant though.
Check out the HTTP HEAD method.

how the update messages in stack overflow site are being shown

i would like to know how the update messages in this stack overflow site have been implemented.
To be more precise, for example while i am trying to reply for question and i am in the middle of typing my response, i will see a message on top of the page saying a new answer has been added. How is this feature has been implemented.
AFAIK, the possible way can be HTML5 websocket or serversocket technology.
is there any other way to achieve this kind of push notification system especially using java, spring and jquery environment?
Not sure how to tag this question. correct the tags if i am wrong.
SO uses reverse ajax/comet technology to show those messages. I remember reading some discussion on meta about this feature, couldn't exactly find out the link for it at this moment. Will update as soon as I find.
Based on programming language framework name may change (websockets (or) socket.io etc.,), but at the end they all are from comet framework.
Update:
Here is SO meta discussion on this topic.
I have used the Direct Web Remoting framework with success. (DWR).
There are several ways to achieve that:
Polling: using JQuery you issue a request regularly (every 5sec for examples) which retrieves the updates from the server.
Streaming: you issue a request, the server does not set a Content-Length to the response and "never" close the socket. This way you can send data from server to client whenever you want. But it means that for every client a connection is hold by your server.
Long polling: mix between the two previous ways. The connection is hold by the server but with a timeout. If no new data is available, the server closes the connection and the client reopen a new one after a moment.
Thoses are Push technologies: http://en.wikipedia.org/wiki/Push_technology
Of course there are over ways to achieve that.

How does UPnP works?

I am doing an app which renders a web page in an upnp enabled television set. I have implemented the UPnP with Cling UPnP
Now I am not sure how to proceed further. How is the connection between the Television and the device attained? Is it a socket connection? has anybody got any samples or tutorials regarding this topic which help me to implement UPnP streaming.
I have searched on google but it mainly points to existing apps available in google play.
Thanks
Ok, so the service descriptor xml (SCPD) contains <actionList> of <action>s with their parameters, which can be in (to the TV) or out (will be in the TV's response to the action). You need to "call" the action, which means that Cling serializes it to SOAP RPC and sends it to the device as HTTP request. In the response, you will get the overall result of the call as with plain HTTP, 200 for OK, 500 for Bad Request, etc. Each code has a specific explanation in context of the particular action call. The response will also hold out parameters as specified in the SCPD.
But this all is not as much of your interest when using an abstraction library like Cling. It will do everything for you. Disclaimer: i am not familiar with Cling, just with enough other UPnP libs to know where to look for things.
As a TV set, the 3 services you mention will be undoubtely AVTransport,ConnectionManager and RenderingControl. So to present a simple example which will actually do something observable on the TV, let's call RenderingControl.SetVolume. The method you need is org.teleal.cling.support.renderingcontrol.callback.SetVolume. I can't help you to the level of knowing where to obtain the Service parameter, but you should be able to figure out.
I am not saying that you don't need to know how UPnP works under the hood. Grabbing the UPnP specs bundle and reading at least the DeviceArchitecture pdf is indispensable. And you will definitely need the specs to understand the more complicated services like AVTransport. Hint: don't care about InstanceID and ConnectionID. It's all 0 unless you connect to a very advanced renderer (which the TVs nowadays are not).

Java Daemon For Reading Email and Creating JIRA Ticket?

So what I need is basically to create a java program that runs from command line and will continue to run until I decide to stop it. The goal of this program is to read email from a particular email address and create JIRA tickets using the contents of the email.
IE: subject of email will be title. Body will be description. Etc...
I am getting confused with how to go about with the design of how to do this. I know I can use JavaMail to gain access to the emails right? Then I just have to parse the email. But other than that I am a little stuck on how I should be making the JIRA Ticket
Thanks!
Your problem is an ideal use case for esb like mule or spring-integration. Basically these eip frameworks provide all building blocks you just need to connect.
First you need to define mail inbound. This component will automatically connect to an mail inbox and fetch all new messages.
Then define a transformation from e-mail message to json object. Finally POST that object using HTTP outbound. You can create ticket in JIRA using /rest/api/2/issue API method.
whole workflow can be implemented almost without coding. Of course you can do everything manually (using javamail and httpclient), but then threading, error handling and retrying is up to you.
For the future - if you're confused what requests are sent and so on - use Google Chrome.
Press Ctrl+Shift+I->Network and make request. If you need to login before etc. it is the same.
For handling HTTP requests (POST, GET, etc.) I recommend to use HttpClient or if you need to use JavaScript HtmlUnit.
So answer is this:
- Track what requests are made when you do certain things via web browser
- implements the same in Java code using HttpClient or HtmlUnit

Categories

Resources