Search…
⌃K
Links

Getting Started

The current release (v0.4.0) - Schemaverse management can be done via Memphis GUI
v0.4.1 will support SDK-driven management as well

Step 1: Create a new schema

GUI
Code
Head to the "Schemaverse" page
Create a new schema by clicking on "Create from blank"
Soon

Step 2: Attach Schema

GUI
Code
Head to your station, and on the top-left corner, click on "+ Attach schema"

Step 3: Code examples

Node.js
Go
Python
Typescript
Memphis abstracts the need for external serialization functions and embeds them within the SDK.

Producer (Protobuf example)

1
const memphis = require("memphis-dev");
2
var protobuf = require("protobufjs");
3
4
(async function () {
5
try {
6
await memphis.connect({
7
host: "localhost",
8
username: "root",
9
connectionToken: "memphis"
10
});
11
const producer = await memphis.producer({
12
stationName: "marketing-partners.prod",
13
producerName: "prod.1"
14
});
15
var payload = {
16
fname: "AwesomeString",
17
lname: "AwesomeString",
18
id: 54,
19
};
20
try {
21
await producer.produce({
22
message: payload
23
});
24
} catch (ex) {
25
console.log(ex.message)
26
}
27
} catch (ex) {
28
console.log(ex);
29
memphis.close();
30
}
31
})();

Consumer (Requires .proto file to decode messages)

1
const memphis = require("memphis-dev");
2
var protobuf = require("protobufjs");
3
4
(async function () {
5
try {
6
await memphis.connect({
7
host: "localhost",
8
username: "root",
9
connectionToken: "memphis"
10
});
11
12
const consumer = await memphis.consumer({
13
stationName: "marketing",
14
consumerName: "cons1",
15
consumerGroup: "cg_cons1",
16
maxMsgDeliveries: 3,
17
maxAckTimeMs: 2000,
18
genUniqueSuffix: true
19
});
20
21
const root = await protobuf.load("schema.proto");
22
var TestMessage = root.lookupType("Test");
23
24
consumer.on("message", message => {
25
const x = message.getData()
26
var msg = TestMessage.decode(x);
27
console.log(msg)
28
message.ack();
29
});
30
consumer.on("error", error => {
31
console.log(error);
32
});
33
} catch (ex) {
34
console.log(ex);
35
memphis.close();
36
}
37
})();
Memphis abstracts the need for external serialization functions and embeds them within the SDK.

Producer (Protobuf example)

Consumer (Requires .proto file to decode messages)

1
Last modified 27d ago