11import { expect } from "chai"
2+ import { randomUUID } from "crypto"
3+ import { readFileSync } from "fs"
4+ import path from "path"
25import { Client , Publisher } from "../../src"
36import {
7+ AmqpByte ,
48 Message ,
59 MessageAnnotations ,
610 MessageApplicationProperties ,
7- MessageProperties ,
811 MessageHeader ,
9- AmqpByte ,
12+ MessageProperties ,
1013} from "../../src/publisher"
1114import { Offset } from "../../src/requests/subscribe_request"
15+ import { BufferDataReader } from "../../src/response_decoder"
16+ import { getMaxSharedConnectionInstances , range } from "../../src/util"
1217import {
1318 createClient ,
1419 createConsumer ,
@@ -17,20 +22,14 @@ import {
1722 createStreamName ,
1823} from "../support/fake_data"
1924import { Rabbit , RabbitConnectionResponse } from "../support/rabbit"
20- import { getMaxSharedConnectionInstances , range } from "../../src/util"
21- import { BufferDataReader } from "../../src/response_decoder"
2225import {
26+ decodeMessageTesting ,
2327 eventually ,
2428 expectToThrowAsync ,
25- username ,
26- password ,
27- createClassicPublisher ,
28- decodeMessageTesting ,
2929 getTestNodesFromEnv ,
30+ password ,
31+ username ,
3032} from "../support/util"
31- import { readFileSync } from "fs"
32- import path from "path"
33- import { randomUUID } from "crypto"
3433
3534describe ( "declare consumer" , ( ) => {
3635 let streamName : string
@@ -242,32 +241,6 @@ describe("declare consumer", () => {
242241 await eventually ( async ( ) => expect ( messageAnnotations ) . eql ( [ annotations ] ) )
243242 } ) . timeout ( 10000 )
244243
245- it ( "messageAnnotations are ignored by a classic driver" , async ( ) => {
246- const messageAnnotations : MessageAnnotations [ ] = [ ]
247- const annotations = createAnnotations ( )
248- const classicPublisher = await createClassicPublisher ( )
249- await classicPublisher . ch . assertQueue ( "testQ" , {
250- exclusive : false ,
251- durable : true ,
252- autoDelete : false ,
253- arguments : {
254- "x-queue-type" : "stream" , // Mandatory to define stream queue
255- } ,
256- } )
257-
258- classicPublisher . ch . sendToQueue ( "testQ" , Buffer . from ( "Hello" ) , {
259- headers : {
260- messageAnnotations : annotations ,
261- } ,
262- } )
263-
264- await eventually ( async ( ) => {
265- expect ( messageAnnotations ) . to . be . empty
266- await classicPublisher . ch . close ( )
267- await classicPublisher . conn . close ( )
268- } )
269- } ) . timeout ( 10000 )
270-
271244 it ( "messageAnnotations with bytes are read correctly" , async ( ) => {
272245 const messageAnnotations : MessageAnnotations [ ] = [ ]
273246 const annotations = { test : new AmqpByte ( 123 ) }
0 commit comments