This section describes Memphis producer API
A producer is the source application/service that pushes data or messages to the broker or more specifically, to the station.
As the user configures a client connection to Memphis, it comprises several objects
- Connection - An open socket between the client to Memphis. Only required once as the client/application gets initialized for the first time.
- Producer - A producer entity must be declared to write data/messages into Memphis.
- (And/Or) Consumer - A consumer entity must be declared to read data/messages from Memphis.
Memphis forked NATS which receives, stores, and sends data in binary format for performance, format alignment, and efficient memory allocations.
When a producer produces messages to Memphis station, they should be converted into binary.
An example from the
message: Buffer.from("Message: Hello world"),
Unexist stations will be created automatically through the SDK on the first producer/consumer connection.
(*) Names might be a bit different from one SDK to another. Meanings are the same.
a host: Memphis URL
port: Memphis port
username: Can be root or any other application-type user
password: Each application-type user comprises both a username and a password
connectionToken: *Valid only in case connection-token-based authentication was chosen* The token received when the user created. Will change in the future to more robust credentials and authentication system
reconnect: The connection entity will try to reconnect to Memphis in case of a disconnection
maxReconnect: Amount of time the client will try to reconnect before backing off
reconnectIntervalMs: Time window between one retry to another
timeoutMs: Ability to kill a dead connection after explicit time
stationName: The name of the station to be connected
producerName: In a station resolution, each connected producer must have a unique identity
A producer is a logical entity that writes data to a Memphis station. By adding more producers, the throughput will be increased accordingly due to the additional writers.