Skip to content

Commit 9b547b6

Browse files
committed
implement direct reply to feature
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
1 parent 700c525 commit 9b547b6

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

pkg/rabbitmqamqp/amqp_types.go

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,14 @@ func (mo *managementOptions) id() string {
8686
return "management"
8787
}
8888

89-
func (mo *managementOptions) validate(available *featuresAvailable) error {
89+
func (mo *managementOptions) validate(_ *featuresAvailable) error {
9090
return nil
9191
}
9292

93+
func (mo *managementOptions) isDirectReplyToEnable() bool {
94+
return false
95+
}
96+
9397
// ConsumerOptions represents the options for quorum and classic queues
9498
type ConsumerOptions struct {
9599
//ReceiverLinkName: see the IConsumerOptions interface
@@ -121,10 +125,9 @@ func (aco *ConsumerOptions) id() string {
121125

122126
func (aco *ConsumerOptions) validate(available *featuresAvailable) error {
123127
// direct reply to is supported since RabbitMQ 4.2.0
124-
if aco.DirectReplyToEnable {
125-
if !available.is42rMore {
126-
return fmt.Errorf("direct reply to feature is not supported. You need RabbitMQ 4.2 or later")
127-
}
128+
if aco.DirectReplyToEnable && !available.is42rMore {
129+
return fmt.Errorf("direct reply to feature is not supported. You need RabbitMQ 4.2 or later")
130+
}
128131

129132
return nil
130133
}
@@ -235,8 +238,7 @@ type StreamConsumerOptions struct {
235238
// see the interface implementations
236239
Offset IOffsetSpecification
237240
StreamFilterOptions *StreamFilterOptions
238-
239-
Id string
241+
Id string
240242
}
241243

242244
func (sco *StreamConsumerOptions) linkName() string {
@@ -362,6 +364,10 @@ func (sco *StreamConsumerOptions) validate(available *featuresAvailable) error {
362364
return nil
363365
}
364366

367+
func (sco *StreamConsumerOptions) isDirectReplyToEnable() bool {
368+
return false
369+
}
370+
365371
///// PublisherOptions /////
366372

367373
type IPublisherOptions interface {

0 commit comments

Comments
 (0)