public class AndesClient extends Object
| Constructor and Description |
|---|
AndesClient(AndesJMSClientConfiguration config,
boolean createConsumersAndProducers)
Creates a single consumer or publisher based on the configuration passed
|
AndesClient(AndesJMSClientConfiguration config,
int numberOfThreads,
boolean createConsumersAndProducers)
The constructor used for creating multiple consumer or publishers based on the configuration
passed.
|
| Modifier and Type | Method and Description |
|---|---|
Map<Long,Integer> |
checkIfMessagesAreDuplicated()
Gets the duplicated messages received for a single consumer.
|
boolean |
checkIfMessagesAreInOrder()
Checks whether the received messages are in order for a single consumer.
|
boolean |
checkIfTransactedRollbackPreservesOrder(long messagesPerRollback)
This method will check whether received messages are ordered correctly for a single consumer
when rollback.
|
double |
getAverageLatency()
Gets the average latency for consumer(s).
|
List<AndesJMSConsumer> |
getConsumers()
Gets the all the consumers created by the client.
|
double |
getConsumerTPS()
Gets the average transactions per second for consumer(s).
|
List<AndesJMSPublisher> |
getPublishers()
Gets the all the publisher created by the client.
|
double |
getPublisherTPS()
Gets the average transactions per seconds for publisher(s).
|
long |
getReceivedMessageCount()
Gets the received messages for all consumers in the client.
|
List<String> |
getReceivedMessages()
This method returns received messages for a single consumer.
|
long |
getSentMessageCount()
Gets the number of messages sent by the publisher(s).
|
long |
getTotalNumberOfDuplicates()
This method returns number of duplicate received messages for a single consumer.
|
void |
setStartDelay(long startDelay)
Sets the starting delay when starting publishers or consumers.
|
void |
startClient()
Starts up the consumer(s) or publisher(s) to consume or publish messages.
|
void |
stopClient()
Stops the client from publishing or consuming messages.
|
boolean |
transactedOperation(long operationOccurredIndex)
This method returns whether received messages are transacted for a single consumer.
|
public AndesClient(AndesJMSClientConfiguration config, boolean createConsumersAndProducers) throws NamingException, javax.jms.JMSException, AndesClientException, IOException
config - The configuration.createConsumersAndProducers - True if the client needs to create connections, sessions
and respecting receivers or consumers. False otherwise.javax.jms.JMSException - Thrown when creating the JMS sessions, connection and receiver
or sender based on consumer or producer.NamingException - Thrown when invalid lookup is used in the initial context.AndesClientExceptionIOExceptionpublic AndesClient(AndesJMSClientConfiguration config, int numberOfThreads, boolean createConsumersAndProducers) throws IOException, javax.jms.JMSException, NamingException, AndesClientException
config - The configuration.numberOfThreads - The amount of publishers or consumers. This amount of
threads will be started.createConsumersAndProducers - True if the client needs to create connections, sessions
and respective receivers or consumers. False otherwise.javax.jms.JMSException - Thrown when creating the JMS sessions, connection and receiver
or sender based on consumer or producer.NamingException - Thrown when invalid lookup is used in the initial context.AndesClientException - Thrown when invalid number of threads are used.IOExceptionpublic void startClient()
throws AndesClientException,
javax.jms.JMSException,
IOException
javax.jms.JMSException - Thrown when broker does not adhere to JMS functions.IOException - Thrown when trying to read contents from a file.AndesClientExceptionpublic void stopClient()
throws javax.jms.JMSException
javax.jms.JMSException - Thrown when closing the connections, session and receiver or sender
based on a consumer and a publisher.public long getReceivedMessageCount()
public double getConsumerTPS()
public double getAverageLatency()
public long getSentMessageCount()
public double getPublisherTPS()
public Map<Long,Integer> checkIfMessagesAreDuplicated() throws IOException
IOException - Thrown when the received messages file is either missing or corrupted.public boolean checkIfMessagesAreInOrder()
throws IOException
IOException - Thrown when the received messages file is either missing or corrupted.public boolean transactedOperation(long operationOccurredIndex)
throws IOException
operationOccurredIndex - Index of the operated message most of the time last message.IOExceptionpublic boolean checkIfTransactedRollbackPreservesOrder(long messagesPerRollback)
throws IOException
messagesPerRollback - number of messages per each rollback occurrence by subscriber.IOExceptionpublic long getTotalNumberOfDuplicates()
throws IOException
IOExceptionpublic void setStartDelay(long startDelay)
startDelay - The starting delaypublic List<AndesJMSConsumer> getConsumers()
List of
AndesJMSConsumer.public List<AndesJMSPublisher> getPublishers()
List of
AndesJMSPublisher.Copyright © 2019 WSO2. All rights reserved.