I'm using this library to connect to amqp server, but getting this error. javax.jms.JMSException: Channel was inactive for too (>30000) long: tcp://127.0.0.1:5672
@Component
@Slf4j
public class ActiveMQProducerService implements GenericHandler {
@Autowired
JmsTemplate jmsTemplate;
@Value("${topic}")
private String topic;
public Sensor sendMessage(String payload){
try{
log.info("Sending message to Topic: "+ topic);
//jmsTemplate.convertAndSend(topic, payload);
jmsTemplate.convertAndSend(topic,payload);
log.info("Message sent to topic = "+topic);
} catch(Exception e){
//throw new SensorDataProcessingException("Received Exception during sending for Message: "+sensor.toString());
log.error("Received Exception during sending for Message: "+sensor.toString(), e);
}
return sensor;
}
@Override
public Object handle(String payload, MessageHeaders headers) {
sendMessage(payload);
return payload;
}
}
Can anyone help me why I get this error ?
If I run your amqp-10-jms-spring-boot-hello-world, then it is working fine. My activeMQ server is also running properly on my local system. I don't know why I get this error.
Is the error from the client or from the server side. It would be unlikely to have anything to do with the starter as it is just a simple wrapper around Qpid JMS
I'm using this library to connect to amqp server, but getting this error. javax.jms.JMSException: Channel was inactive for too (>30000) long: tcp://127.0.0.1:5672
application.yml
amqphub.amqp10jms.remote-url: amqp://127.0.0.1:5672
build.gradle
plugins { id 'org.springframework.boot' }
group = 'com.xxx.xxxxx' version = '0.0.1-SNAPSHOT'
ext { influxDBVersion = "6.7.0"
}
tasks.named("jar") { enabled = false }
tasks.named("bootJar") { archiveFileName = "iot-gateway" }
repositories { mavenCentral() }
configurations { compileOnly { extendsFrom annotationProcessor }
}
dependencies {
}
tasks.named('test') { useJUnitPlatform() }
ActiveMQProducerService.java
@Component @Slf4j public class ActiveMQProducerService implements GenericHandler {
@Autowired
JmsTemplate jmsTemplate;
}
Can anyone help me why I get this error ? If I run your amqp-10-jms-spring-boot-hello-world, then it is working fine. My activeMQ server is also running properly on my local system. I don't know why I get this error.