@Override protected AbstractAmqpChannel doGet() { Assert.notNull(getId(), "The 'id' or 'queueName' must be specified"); try { this.channel = this.amqpChannelFactoryBean.getObject(); } catch (Exception e) { throw new BeanCreationException("Cannot create the AMQP MessageChannel", e); } return super.doGet(); }
@Test public void testAmqpChannelFactoryBean() throws Exception { AmqpChannelFactoryBean channelFactoryBean = new AmqpChannelFactoryBean(); channelFactoryBean.setBeanFactory(mock(BeanFactory.class)); channelFactoryBean.setConnectionFactory(this.connectionFactory); channelFactoryBean.setBeanName("testChannel"); channelFactoryBean.afterPropertiesSet(); AbstractAmqpChannel channel = channelFactoryBean.getObject(); assertThat(channel, instanceOf(PointToPointSubscribableAmqpChannel.class)); channelFactoryBean = new AmqpChannelFactoryBean(); channelFactoryBean.setBeanFactory(mock(BeanFactory.class)); channelFactoryBean.setConnectionFactory(this.connectionFactory); channelFactoryBean.setBeanName("testChannel"); channelFactoryBean.setPubSub(true); channelFactoryBean.afterPropertiesSet(); channel = channelFactoryBean.getObject(); assertThat(channel, instanceOf(PublishSubscribeAmqpChannel.class)); RabbitAdmin rabbitAdmin = new RabbitAdmin(this.connectionFactory); rabbitAdmin.deleteQueue("testChannel"); rabbitAdmin.deleteExchange("si.fanout.testChannel"); }
@Override protected AbstractAmqpChannel doGet() { Assert.notNull(getId(), "The 'id' or 'queueName' must be specified"); try { this.channel = this.amqpChannelFactoryBean.getObject(); } catch (Exception e) { throw new BeanCreationException("Cannot create the AMQP MessageChannel", e); } return super.doGet(); }
@Override protected AbstractAmqpChannel doGet() { Assert.notNull(getId(), "The 'id' or 'queueName' must be specified"); try { this.channel = this.amqpChannelFactoryBean.getObject(); } catch (Exception e) { throw new BeanCreationException("Cannot create the AMQP MessageChannel", e); } return super.doGet(); }
@Override protected AbstractAmqpChannel doGet() { Assert.notNull(getId(), "The 'id' or 'queueName' must be specified"); try { this.channel = this.amqpChannelFactoryBean.getObject(); } catch (Exception e) { throw new BeanCreationException("Cannot create the AMQP MessageChannel", e); } return super.doGet(); }