refactor: update type define

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-10-02 16:20:33 +08:00
parent 14f20897d6
commit 80fbc071ed
15 changed files with 5 additions and 379 deletions

View File

@ -2,7 +2,7 @@ import { ConnectionFactoryAdapter, ConnectionFactory } from "./connection"
import { ChannelAwareMessageListenerAdapter, ChannelAwareMessageListener } from "./listener"
export const SimpleMessageListenerContainer = org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer
export const AcknowledgeMode: org.springframework.amqp.core.AcknowledgeMode = Java.type('org.springframework.amqp.core.AcknowledgeMode')
export const AcknowledgeMode = org.springframework.amqp.core.AcknowledgeMode
interface ContainerConfig {
connectionFactory: ConnectionFactoryAdapter | typeof ConnectionFactory
queueNames: string[]
@ -27,4 +27,4 @@ export class MessageListenerContainerAdapter {
getHandler() {
return this._Handler
}
}
}

View File

@ -46,7 +46,7 @@ export class AmqpAdmin {
}
declareBinding(queue: string, exchange: string, routerKey: string, argument: any = null) {
let binding = new this.Binding(queue, this.DestinationType.QUEUE, exchange, routerKey, argument)
let binding = new this.Binding(queue, org.springframework.amqp.core.Binding.DestinationType.QUEUE, exchange, routerKey, argument)
this.amqpAdmin.declareBinding(binding)
return this
}
@ -86,4 +86,4 @@ export class SimpleMessageHandler extends ChannelAwareMessageListenerAdapter {
onMessage(content: any, message: org.springframework.amqp.core.Message, channel: com.rabbitmq.client.Channel) {
return this.handler(content, message, channel)
}
}
}