Main Content

stopServer

Shut down local test server

Since R2022b

    This function requires Streaming Data Framework for MATLAB® Production Server™ and MATLAB Compiler SDK™.

    Description

    stopServer(esp) shuts down the local test server (development version of MATLAB Production Server) used to simulate event processing in a production environment.

    example

    Examples

    collapse all

    Assume that you have a Kafka® server running at the network address kafka.host.com:9092 that has a topic RecamanSequence.

    Also assume that you have a stateful streaming analytic function recamanSum and initialization function initRecamanSum.

    Create a KafkaStream object connected to the RecamanSequence topic.

    ks = kafkaStream("kafka.host.com",9092,"RecamanSequence");

    Create an EventStreamProcessor object that runs the recamanSum function, which is initialized by the initRecamanSum function.

    esp = eventStreamProcessor(ks,@recamanSum,@initRecamanSum);

    Start the local test server, which also opens the development version of MATLAB Production Server in the Production Server Compiler (MATLAB Compiler SDK) app.

    startServer(esp);

    You can then use the start and stop functions to start and stop event processing, respectively.

    stop causes the client of the EventStreamProcessor object to stop sending events from the stream to the local test server, but it does not shut down the server. After you finish testing the processing of events, stop the test server by calling stopServer.

    stopServer(esp);

    Input Arguments

    collapse all

    Object to process event streams, specified as an EventStreamProcessor object.

    Version History

    Introduced in R2022b