Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

java client code does not work well #146

@turbo-xp

Description

@turbo-xp
   @PostConstruct
public void init() {
	System.out.println("----------------------");
	ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(1);
	scheduledThreadPoolExecutor.execute(new Runnable() {
		@Override
		public void run() {
			try {
				startUp();
			} catch (URISyntaxException e) {
				e.printStackTrace();
			}
		}
	});
	System.out.println("----------------------");
}

    private void startUp() throws URISyntaxException {
	DeepstreamClient client = new DeepstreamClient("localhost:6020");
	client.addConnectionChangeListener(new ConnectionStateListener() {
		@Override
		public void connectionStateChanged(ConnectionState arg0) {
			System.out.println(arg0.name());
		}
	});
	client.setRuntimeErrorHandler(new DeepstreamRuntimeErrorHandler() {
		@Override
		public void onException(Topic arg0, Event arg1, String arg2) {
			System.out.println(arg2);
		}
	});

	LoginResult result = client.login(null);
	if (result.loggedIn()) {
		System.out.println("loggedIn");
	}
}

and the console log is

RECONNECTING
AWAITING_CONNECTION
RECONNECTING
AWAITING_CONNECTION
RECONNECTING
AWAITING_CONNECTION

do i has the uncorrect code ?? waiting for your reply online ....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions