One bus: the AMQP transport is gone from the host
The mesh runs on the seat's bus alone (novox/hq ADR 0131, design 28 task 5.5). The host's old dialling and enrolment paths are deleted with the switch that chose between them; a membership or a token naming another bus is refused before anything is sent, rather than dialled on a transport that no longer exists.
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/nats-io/nats.go"
|
||||
amqp "github.com/rabbitmq/amqp091-go"
|
||||
)
|
||||
|
||||
// Bus is what a host needs of the mesh's bus, in the mesh's own words.
|
||||
@@ -34,22 +33,6 @@ type Bus interface {
|
||||
|
||||
// --- The bus the mesh runs on today -----------------------------------------------------------
|
||||
|
||||
// OverCurrent is the bus as a channel, until the rollout.
|
||||
type OverCurrent struct{ Channel *amqp.Channel }
|
||||
|
||||
func (b OverCurrent) Report(ctx context.Context, node string, body []byte) error {
|
||||
// Mandatory: an unroutable report comes back rather than disappearing.
|
||||
return b.Channel.PublishWithContext(ctx, Exchange, KeyReport, true, false,
|
||||
amqp.Publishing{ContentType: "application/json", Body: body})
|
||||
}
|
||||
|
||||
func (b OverCurrent) Alive(ctx context.Context, node string, body []byte) error {
|
||||
return b.Channel.PublishWithContext(ctx, Exchange, KeyAlive, false, false,
|
||||
amqp.Publishing{ContentType: "application/json", Body: body})
|
||||
}
|
||||
|
||||
// --- NATS ---------------------------------------------------------------------------------
|
||||
|
||||
// OverNATS is the bus as a connection. A report goes through JetStream because it must survive
|
||||
// the controller's store restarting; a heartbeat does not, because it must not.
|
||||
type OverNATS struct {
|
||||
|
||||
Reference in New Issue
Block a user