camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g306652 <g306...@mvrht.net>
Subject Exception while producing SNMPv1Trap
Date Thu, 15 Jun 2017 12:48:50 GMT
Hi Everyone,

I have recently tried to produce SNMPv1 Trap using camel-snmp component. As
I noticed, "process" method of SnmpTrapProducer tries to set max repetitions
setting of PDU to 0 (At line 114 in given following github reference link).
But this method is defined as;

/    public void setMaxRepetitions(int maxRepetitions) {
        throw new UnsupportedOperationException("Operation not supported for
SNMPv1 PDUs");
    }/

in PDUv1 class. So I get this exception;

/java.lang.UnsupportedOperationException: Operation not supported for SNMPv1
PDUs
	at org.snmp4j.PDUv1.setMaxRepetitions(PDUv1.java:296)
~[org.apache.servicemix.bundles.snmp4j-2.3.4_1.jar:?]
	at
org.apache.camel.component.snmp.SnmpTrapProducer.process(SnmpTrapProducer.java:114)
~[classes/:?]
	at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
~[camel-core-2.19.2-20170614.220129-4.jar:2.19.2-SNAPSHOT]
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
~[camel-core-2.19.2-20170614.220129-4.jar:2.19.2-SNAPSHOT]
	at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:541)
[camel-core-2.19.2-20170614.220129-4.jar:2.19.2-SNAPSHOT]
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
[camel-core-2.19.2-20170614.220129-4.jar:2.19.2-SNAPSHOT]
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
[camel-core-2.19.2-20170614.220129-4.jar:2.19.2-SNAPSHOT]
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
[camel-core-2.19.2-20170614.220129-4.jar:2.19.2-SNAPSHOT]
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
[camel-core-2.19.2-20170614.220129-4.jar:2.19.2-SNAPSHOT]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97)
[camel-core-2.19.2-20170614.220129-4.jar:2.19.2-SNAPSHOT]
	at
org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:47)
[camel-core-2.19.2-20170614.220129-4.jar:2.19.2-SNAPSHOT]/

In SnmpTrapProducer.java;

/            trap.setErrorIndex(0);
            trap.setErrorStatus(0);
            trap.setMaxRepetitions(0);  // this call is not supported by
version1
            if (this.endpoint.getSnmpVersion() == SnmpConstants.version1) {
                trap.setType(PDU.V1TRAP);
            } else {
                trap.setType(PDU.TRAP);
            }/

I've started to use Apache Camel from just today, so I'm not sure that is a
bug or my mistake.

Github link:  SnmpTrapProducer.java
<https://github.com/apache/camel/blob/camel-2.19.x/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpTrapProducer.java>
 

Regards.




--
View this message in context: http://camel.465427.n5.nabble.com/Exception-while-producing-SNMPv1Trap-tp5804158.html
Sent from the Camel Development mailing list archive at Nabble.com.

Mime
View raw message