Configuring Java Client

Learn to configure the Java client.

Introduction

For Java clients, logging is configured via the following package:

org.slf4j:slf4j-jdk14

If you don’t have this package installed, some errors will appear in your application’s console. But those will not prevent your application from working.

We will now apply some configuration to our Java client that we have created previously. And the first thing we will do is open our App.java file and replace the instantiation of the hubConnection object with the following code:

Press + to interact
HubConnection hubConnection = HubConnectionBuilder.create(input)
.withHeader("Key", "value")
.shouldSkipNegotiate(true)
.withHandshakeResponseTimeout(30*1000)
.withTransport(TransportEnum.WEBSOCKETS)
.build();

These configuration options are available to us when a SignalR connection ...