Skip to content

Create Consumer

//trimblecloud-events/trimblecloud.events/ConsumerFactory/createConsumer

createConsumer

[JVM]
open fun createConsumer(responseCallback: BiConsumer<Response, ConsumerException>): Consumer

Creates a consumer based on the consumer type and properties.

Return

The created consumer instance.

Parameters

JVM

responseCallbackLambda expression which acts as a websocket listener that consumes event and any exceptions from the Events server. Response.getResponseMessage() contains the poll response from the server. ConsumerException object is not null, then there is an exception for the request that has been sent to the server.

Throws

ConsumerExceptionIf there is an error creating the consumer.