You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Gregor Kopij (JIRA)" <ji...@apache.org> on 2012/05/11 20:16:50 UTC

[jira] [Updated] (CAMEL-5264) SNMP-Component doesn't response to INFORM-Traps

     [ https://issues.apache.org/jira/browse/CAMEL-5264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregor Kopij updated CAMEL-5264:
--------------------------------

    Attachment: snmp-inform.patch

Patch attached. I hope it's ok. I've used the version from trunk.
                
> SNMP-Component doesn't response to INFORM-Traps
> -----------------------------------------------
>
>                 Key: CAMEL-5264
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5264
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-snmp
>    Affects Versions: 2.9.2
>            Reporter: Gregor Kopij
>            Priority: Minor
>         Attachments: snmp-inform.patch
>
>
> 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:
> {code:lang=java}
> 			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);
> {code}
> In this case the component sends a response to the sender before processing the message.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira