This commit is contained in:
sujit
2025-09-24 16:01:07 +05:45
parent cb2869c98b
commit ca422e5fda
10 changed files with 826 additions and 708 deletions

21
examples/consumer.go Normal file
View File

@@ -0,0 +1,21 @@
package main
import (
"context"
"github.com/oarkflow/mq"
"github.com/oarkflow/mq/examples/tasks"
)
func main() {
n := &tasks.Node6{}
consumer1 := mq.NewConsumer("F", "queue1", n.ProcessTask,
mq.WithBrokerURL(":8081"),
mq.WithHTTPApi(true),
mq.WithWorkerPool(100, 4, 50000),
mq.WithSecurity(true),
mq.WithUsername("consumer"),
mq.WithPassword("con123"),
)
consumer1.Consume(context.Background())
}