mirror of
				https://github.com/oarkflow/mq.git
				synced 2025-10-31 15:16:20 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			408 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			408 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package main
 | |
| 
 | |
| import (
 | |
| 	"context"
 | |
| 	"github.com/oarkflow/mq"
 | |
| 
 | |
| 	"github.com/oarkflow/mq/examples/tasks"
 | |
| )
 | |
| 
 | |
| func main() {
 | |
| 	consumer := mq.NewConsumer("consumer-1")
 | |
| 	// consumer := mq.NewConsumer("consumer-1", mq.WithTLS(true, "./certs/server.crt", "./certs/server.key"))
 | |
| 	consumer.RegisterHandler("queue1", tasks.Node1)
 | |
| 	consumer.RegisterHandler("queue2", tasks.Node2)
 | |
| 	consumer.Consume(context.Background())
 | |
| }
 | 
