Starter
For your first application.
$19/ month
Per organization · USD
- Teams2
- Queues10
- Pub/Sub topics5
- Team-scoped API keys
- Managed infrastructure
Start with your first application. Make room for more teams and workloads as your organization grows. PlainQ handles the infrastructure.
For your first application.
$19/ month
Per organization · USD
For teams building together.
$49/ month
Per organization · USD
For more teams and workloads.
$149/ month
Per organization · USD
Create your organization, connect your application, and put your queues to work. PlainQ takes care of the infrastructure underneath.
Go SDK · gRPC: receive and acknowledge a message from a native PlainQ server. Use the same PLAINQ_ADDR as the send example and set PLAINQ_QUEUE_ID to its printed queue ID. For Cloud HTTP connections, follow the Cloud quickstart.
package main
import (
"context"
"log"
"os"
"time"
plainq "github.com/marsolab/plainq-go-sdk"
v1 "github.com/marsolab/plainq-go-sdk/v1"
)
func main() {
client, err := plainq.New(os.Getenv("PLAINQ_ADDR"))
if err != nil { log.Fatal(err) }
defer client.Close()
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()
queueID := os.Getenv("PLAINQ_QUEUE_ID")
received, err := client.Receive(ctx, &v1.ReceiveRequest{
QueueId: queueID, BatchSize: 1, WaitTimeSeconds: 5,
})
if err != nil { log.Fatal(err) }
for _, message := range received.GetMessages() {
log.Printf("received: %s", message.GetBody())
ack, err := client.Delete(ctx, &v1.DeleteRequest{
QueueId: queueID, MessageIds: []string{message.GetId()},
})
if err != nil { log.Fatal(err) }
if len(ack.GetFailed()) > 0 { log.Fatal(ack.GetFailed()) }
}
}