Closed nhj7 closed 7 years ago
Hay @nhj1002 - Thanks for reporting. I'll have a look at it asap.
Add the log.
[2017-10-06 19:02:49] [ INFO] [steemit.SteemApi.checkConnection:93] : [session] : true, uri : wss://steemd.steemit.com [2017-10-06 19:02:49] [ INFO] [steemit.SteemApi.getContentReplies:146] : steemApi.getContentReplies 1 [2017-10-06 19:02:52] [ INFO] [communication.CommunicationHandler.onClose:105] : Connection has been closed.
Add the code.
public static List<Discussion> getContentReplies(String account, String permLink) throws Exception {
checkConnection();
logger.info("steemApi.getContentReplies 1");
final List<Discussion> replies = steemApiWrapper.getContentReplies(account, permLink);
logger.info("steemApi.getContentReplies 2");
/*
for( Discussion post : replies ){
System.out.println( post.getBody() );
}
*/
return replies;
}
Thank you for your quick reply.
Thank you for your quick reply.
Thank you for reporting this - I never noticed it myself as I only run some smaller tests :'(
So the connection is closed after 1 minute without an acitivy - I'll make it possible to configure this time (#114) and implement a reconnection mechanism on top (#113) for SteemJ v0.4.0.
Future version will also support a real failover if a node is totally not available (#100)
Hay @nhj1002 ,
I've done some tests now and I think the current implementation is for sure not perfect, but should already be able to reconnect - Could you tell me which version of SteemJ you are working with?
My test looks like this:
// Create a new apiWrapper with your config object.
SteemJ steemJ = new SteemJ();
try {
Thread.sleep(120000);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Map<Integer, AppliedOperation> accountHistory2 = steemJ.getAccountHistory(new AccountName("dez1337"), 100,
100);
After 60 seconds the connection is closed, but its getting reconnected when the steemJ.getAccountHistory
is called.
Please let me know if this solves your problem
I use 0.3.4
Thank you for the quick reply :)
Hm :( The implementation of 0.3.4 should also already cover this - I am quite optimistic to finish version 0.4.0 this weekend - If you still face the same issue with the new version please comment here once again and I'll reopen the issue.
My application is running with 'steemj'. After normal operation, the following message is displayed.
[2017-10-06 19:02:52] [ INFO] [communication.CommunicationHandler.onClose:105] : Connection has been closed.
After that, it does not work. The value of 'session.isOpen ()' before running 'api' is 'true'.
Does not reconnect () work?