Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-5264

SNMP-Component doesn't response to INFORM-Traps

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.9.2
    • 2.10.0
    • camel-snmp
    • None
    • Moderate

    Description

      When using INFORMs instead of TRAPs the component must response to the Message. Otherwise the sender tries to send the same INFROM x-times and it will be processed x-times in the SNMP-Component.

      The code below is taken from an example:

      			if ((pdu.getType() != PDU.TRAP) &&
      					(pdu.getType() != PDU.V1TRAP) &&
      					(pdu.getType() != PDU.REPORT) &&
      					(pdu.getType() != PDU.RESPONSE)) {
      					pdu.setErrorIndex(0);
      					pdu.setErrorStatus(0);
      					pdu.setType(PDU.RESPONSE);
      					StatusInformation statusInformation = new StatusInformation();
      					StateReference ref = e.getStateReference();
      					try {
      						e.getMessageDispatcher().returnResponsePdu(e.
      							getMessageProcessingModel(),
      							e.getSecurityModel(),
      							e.getSecurityName(),
      							e.getSecurityLevel(),
      							pdu,
      							e.getMaxSizeResponsePDU(),
      							ref,
      							statusInformation);
      						System.err.println("Response sent");
      					}catch (MessageException ex) {
      						System.err.println("Error while sending response: "+ex.getMessage());
      					}
      				}
                  processPDU(pdu);
      
      

      In this case the component sends a response to the sender before processing the message.

      Attachments

        1. snmp-inform.patch
          2 kB
          Gregor Kopij

        Activity

          People

            njiang Willem Jiang
            gregor.kopij Gregor Kopij
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: