Quick start
Create your first station, producer, and consumer in your preferred language.
1. Which Memphis deployment are you using?
Step 1: Sign up for Memphis Cloud here.
Step 2: Hello world
Installation
For Kubernetes
Stable -
helm repo add memphis https://k8s.memphis.dev/charts/ --force-update &&
helm install memphis memphis/memphis --create-namespace --namespace memphis --wait --version=1.2.2Latest -
helm repo add memphis https://k8s.memphis.dev/charts/ --force-update &&
helm install memphis memphis/memphis --create-namespace --namespace memphis --waitMore information can be found in the Memphis k8s deployment documentation.
Docker compose (Syntax for v2)
Stable -
curl -s https://memphisdev.github.io/memphis-docker/docker-compose.yml -o docker-compose.yml && docker compose -f docker-compose.yml -p memphis upLatest -
curl -s https://memphisdev.github.io/memphis-docker/docker-compose-latest.yml -o docker-compose-latest.yml && docker compose -f docker-compose-latest.yml -p memphis upMore information can be found in the Memphis Docker deployment documentation.
2. Hello world
Step 1: Create an empty dir for the Node.js project
mkdir memphis-demo && \
cd memphis-demoStep 2: Create a new Node project (If needed)
npm init -yStep 3: Install memphis Node.js SDK
npm install memphis-devStep 4: Create a new .js file called producer.js
const { memphis } = require("memphis-dev");
(async function () {
let memphisConnection;
try {
memphisConnection = await memphis.connect({
host: "MEMPHIS_BROKER_HOSTNAME",
username: "APPLICATION_TYPE_USERNAME",
password: "PASSWORD",
});
const producer = await memphisConnection.producer({
stationName: "STATION_NAME",
producerName: "PRODUCER_NAME",
});
const headers = memphis.headers();
headers.add("KEY", "VALUE");
await producer.produce({
message: Buffer.from("Message: Hello world"), // you can also send JS object - {}
headers: headers,
});
memphisConnection.close();
} catch (ex) {
console.log(ex);
if (memphisConnection) memphisConnection.close();
}
})();Step 5: Run producer.js
Step 6: Create a new .js file called consumer.js
Step 7: Run consumer.js
Step 1: Create an empty dir for the TypeScript project
Step 2: Create a new Node project (If needed)
Step 3: Install memphis Node.js SDK
Step 4: Create a new .ts file called producer.ts
Step 5: Run producer.ts
Step 6: Create a new .ts file called consumer.ts
Step 7: Run consumer.ts
Step 1: Create an empty dir for the Go project
Step 2: Init the newly created project
Step 3: In your project's directory, install Memphis Go SDK
Step 4: Create a new Go file called producer.go
Step 4: Run producer.go
Step 5: Create a new Go file called consumer.go
Step 6: Run consumer.go
Step 1: Create an empty dir for the Python project
Step 2: In your project's directory, install Memphis Python SDK
Step 3: Create a new Python file called producer.py
Step 4: Run producer.py
Step 5: Create a new Python file called consumer.py
Step 6: Run consumer.py
Step 1: Create a new C# project through Visual Studio or using the dotnet CLI
If you are using top level statements, you will have to create two of these projects.
Step 2: In your project's directory(s), install Memphis C# SDK
Step 3: In your Producer file/project copy this quickstart inside of it
Step 4: Run producer.cs
Step 5: Create a new C# project/file called consumer.cs
Step 6: Run consumer.cs
Producing messages to Memphis via REST API can be implemented using any REST-supported language like Go, Python, Java, Node.js, .NET, etc...
For the following tutorial, we will use Node.js .
Step 1: Create an empty dir for the REST API project
Step 2: Create a new Node project (If needed)
Step 3: Generate a new JWT token generate.js
Step 4: Run generate.js and copy the returned JWT
Step 5: Create a new file called producer.js
More code examples here
Last updated
Was this helpful?


