mirror of
https://github.com/oarkflow/mq.git
synced 2025-10-05 16:06:55 +08:00
update
This commit is contained in:
21
examples/consumer.go
Normal file
21
examples/consumer.go
Normal 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())
|
||||
}
|
Reference in New Issue
Block a user