update
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
|||||||
amqp "github.com/rabbitmq/amqp091-go"
|
amqp "github.com/rabbitmq/amqp091-go"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RabbitTransportMaster struct {
|
type AmqpOrderHandler struct {
|
||||||
Url string
|
Url string
|
||||||
connection *amqp.Connection
|
connection *amqp.Connection
|
||||||
//channel *amqp.Channel
|
//channel *amqp.Channel
|
||||||
@@ -16,7 +16,7 @@ const (
|
|||||||
topic = "order-placed"
|
topic = "order-placed"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (t *RabbitTransportMaster) Connect() error {
|
func (t *AmqpOrderHandler) Connect() error {
|
||||||
|
|
||||||
conn, err := amqp.DialConfig(t.Url, amqp.Config{
|
conn, err := amqp.DialConfig(t.Url, amqp.Config{
|
||||||
//Vhost: "/",
|
//Vhost: "/",
|
||||||
@@ -58,13 +58,13 @@ func (t *RabbitTransportMaster) Connect() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *RabbitTransportMaster) Close() error {
|
func (t *AmqpOrderHandler) Close() error {
|
||||||
log.Println("Closing master channel")
|
log.Println("Closing master channel")
|
||||||
return t.connection.Close()
|
return t.connection.Close()
|
||||||
//return t.channel.Close()
|
//return t.channel.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *RabbitTransportMaster) OrderCompleted(data []byte) error {
|
func (t *AmqpOrderHandler) OrderCompleted(data []byte) error {
|
||||||
ch, err := t.connection.Channel()
|
ch, err := t.connection.Channel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user