Interface JobExecutionSharedAsyncApi


  • public interface JobExecutionSharedAsyncApi
    This interfaces exposes an event source, JobEventSource, that emits events to which a client application can subscribe to.

    It differs from JobExecutionAsyncApi as it allow events to be balanced among multiple client listeners.

    Below an example that shows how to get a shared JobEventSource for a all jobs:
    
       String subscriptionId = "myClientApp";
       JobEventSource eventSource = jobExecutionSharedAsyncApi.getSharedJobEventSource(myClientApp);
     
    Then, you can use the JobEventSource's methods.
    See Also:
    JobEventSource, JobExecutionAsyncApi
    • Method Detail

      • getSharedJobEventSource

        JobEventSource getSharedJobEventSource​(java.lang.String subscriptionId)
        Returns a shared connectable job event source the client can subscribe to.

        The events of all jobs are emitted as the source is connected.

        All clients that use the same subscription id get the events balanced among them. For instance, if two applications listen job solutions for the same subscription id, only one will receives the JobSolution of a particular job.

        Parameters:
        subscriptionId - an id that is used to get events balanced with other client listeners
        Returns:
        A connectable job event source the client can subscribe to.
        See Also:
        JobEventSource