-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QUESTION: Recovery from outages #144
Comments
the xchange project is stateless polling api. depending on when the
disconnect happend you would need to handle the exception generated by
xchange accordingly and main the order state within your application.
here is an example of a class that keeps track of orders and uses the
xchange libs to update the state.
https://github.com/timolson/cointrader/blob/master/src/main/java/org/cryptocoinpartners/module/xchange/XchangeOrderService.java
…On Wed, 28 Feb 2018, 12:45 IanWorthington, ***@***.***> wrote:
Hi Tim --
Interesting project. I've been unable to work out if it recovers fully
from a loss of connection though.
For example if it places a buy order which, during an outage, fills, and I
would like that fill to trigger the placement of specific sell orders, will
all that happen automatically on a restart or reconnection, or is manual
intervention required?
(NB Can't see how to TAG this question, sorry)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#144>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AENHatDMxJ7E5mVG5cho4qWGRIt_Gy1Hks5tZUpjgaJpZM4SWmDr>
.
|
Thanks Douggie -- Not quite sure what you mean by:
|
sorry i mean maintain not main!
…On Wed, 28 Feb 2018, 18:34 IanWorthington, ***@***.***> wrote:
Thanks Douggie --
Not quite sure what you mean by:
main the order state within your application.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#144 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AENHalvVbf5Fq6OvLRhOFSUMwek4HsHIks5tZZwtgaJpZM4SWmDr>
.
|
Hi Douggie -- So, if I understand you correctly after a disconnect I simply need code to pull down the new order status? |
correct, if you disconnect, reconnect and request using the exchange
provided order id to get the latest state.
…On Mon, 5 Mar 2018, 08:24 IanWorthington, ***@***.***> wrote:
Hi Douggie --
So, if I understand you correctly after a disconnect I simply need code to
pull down the new order status?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#144 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AENHanImadFGL_ScQxrwIuEKV28XnA-sks5tbTyMgaJpZM4SWmDr>
.
|
Hi Ian, Sorry this got mixed up an exchange thread. Cointrader maintains all the order state for you and reconnects and determines the latest state. If cointrader fails, it recovers the state from the DB then connects to each exchange and reconciles the latest order state for you at start up. For performance the DB is persisted as a lazy write via a blocking queue, this queue is not durable so if you had a tonne of messages and a slow DB, this queue would back up, if you then restarted coin trader the state of stuff that was in the queue would be lost, in reality I have not see this happen. |
Thanks Douggie. |
Hi Tim --
Interesting project. I've been unable to work out if it recovers fully from a loss of connection though.
For example if it places a buy order which, during an outage, fills, and I would like that fill to trigger the placement of specific sell orders, will all that happen automatically on a restart or reconnection, or is manual intervention required?
(NB Can't see how to TAG this question, sorry)
The text was updated successfully, but these errors were encountered: