@@ -22,7 +22,7 @@ const (
2222IQueueSpecification represents the specification of a queue.
2323The implementation of the queue specification can be used to declare a queue with the specified properties and arguments.
2424The client provides multiple implementations of the queue specification for different use cases,
25- such as DefaultQueueSpecification, QuorumQueueSpecification, ClassicQueueSpecification, JmsQueueSpecification , and AutoGeneratedQueueSpecification.
25+ such as DefaultQueueSpecification, QuorumQueueSpecification, ClassicQueueSpecification, JMSQueueSpecification , and AutoGeneratedQueueSpecification.
2626The client implementations are helpers that cover the most common use cases, but you can implement your own queue
2727specification by implementing the IQueueSpecification interface.
2828*/
@@ -481,9 +481,9 @@ func (s *StreamQueueSpecification) validate(*featuresAvailable) error {
481481}
482482
483483/*
484- JmsQueueSpecification represents the specification of a JMS queue (RabbitMQ queue type "jms").
484+ JMSQueueSpecification represents the specification of a JMS queue (RabbitMQ queue type "jms").
485485*/
486- type JmsQueueSpecification struct {
486+ type JMSQueueSpecification struct {
487487 Name string
488488 Arguments map [string ]any
489489 AutoExpire int64
@@ -499,23 +499,23 @@ type JmsQueueSpecification struct {
499499 SelectorFields []string
500500}
501501
502- func (j * JmsQueueSpecification ) name () string {
502+ func (j * JMSQueueSpecification ) name () string {
503503 return j .Name
504504}
505505
506- func (j * JmsQueueSpecification ) isAutoDelete () bool {
506+ func (j * JMSQueueSpecification ) isAutoDelete () bool {
507507 return false
508508}
509509
510- func (j * JmsQueueSpecification ) isExclusive () bool {
510+ func (j * JMSQueueSpecification ) isExclusive () bool {
511511 return false
512512}
513513
514- func (j * JmsQueueSpecification ) queueType () TQueueType {
514+ func (j * JMSQueueSpecification ) queueType () TQueueType {
515515 return Jms
516516}
517517
518- func (j * JmsQueueSpecification ) buildArguments () map [string ]any {
518+ func (j * JMSQueueSpecification ) buildArguments () map [string ]any {
519519 result := j .Arguments
520520 if result == nil {
521521 result = map [string ]any {}
@@ -550,8 +550,15 @@ func (j *JmsQueueSpecification) buildArguments() map[string]any {
550550 return result
551551}
552552
553- func (j * JmsQueueSpecification ) validate (* featuresAvailable ) error {
554- return nil
553+ func (j * JMSQueueSpecification ) validate (f * featuresAvailable ) error {
554+ // valid only if it is tanzu
555+ if f .isTanzu && f .is43rMore {
556+ return nil
557+ }
558+ // error not support for open source RabbitMQ
559+
560+ return fmt .Errorf ("JMSQueueSpecification is only supported on Tanzu RabbitMQ 4.3 or later" )
561+
555562}
556563
557564// durationToMaxAge converts a time.Duration to the RabbitMQ stream x-max-age string format.
0 commit comments