[ 
https://issues.apache.org/jira/browse/NIFI-14341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17944501#comment-17944501
 ] 

Lehel Boér edited comment on NIFI-14341 at 4/14/25 10:34 PM:
-------------------------------------------------------------

[~dstiegli1] I've spent some time exploring the SNMP agent setup using the new 
{{SampleAgent}} approach, and it’s significantly more complex and time 
consuming to make it testable and reusable. The new API also lacks proper 
documentation and migration guidelines.

I've created a {{MySnmpAgent}} class as a which acts like the BaseAgent class 
and follows the new approach, but it’s not functional yet. I shared it here for 
future reference. 

Since {{BaseAgent}} is only used in IT tests and not in production code, and 
given that the newer {{{}SampleAgent{}}}/{{{}AgentConfigManager{}}} approach 
introduces significant complexity without offering clear benefits or 
documentation, I don’t think this migration should be prioritized right now.

The current implementation is stable and poses no risk to production. Unless 
the class is actually removed from SNMP4J or we have a compelling reason to 
refactor, I’d suggest we defer this upgrade and revisit it if and when it 
becomes necessary.

 

 


was (Author: lehel44):
[~dstiegli1] I've spent some time exploring the SNMP agent setup using the new 
{{SampleAgent}} approach, and it’s significantly more complex and time 
consuming to make it testable and reusable. The new API also lacks proper 
documentation and migration guidelines.

I've created a {{MySnmpAgent}} class as a which acts like the BaseAgent class 
and follows the new approach, but it’s not functional yet. I shared it here for 
future reference. 

Since {{BaseAgent}} is only used in test utilities and not in production code, 
and given that the newer {{{}SampleAgent{}}}/{{{}AgentConfigManager{}}} 
approach introduces significant complexity without offering clear benefits or 
documentation, I don’t think this migration should be prioritized right now.

The current implementation is stable and poses no risk to production. Unless 
the class is actually removed from SNMP4J or we have a compelling reason to 
refactor, I’d suggest we defer this upgrade and revisit it if and when it 
becomes necessary.

 

 

> Replace org.snmp4j.agent.BaseAgent in TestAgent with the API suggested 
> replacement
> ----------------------------------------------------------------------------------
>
>                 Key: NIFI-14341
>                 URL: https://issues.apache.org/jira/browse/NIFI-14341
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Daniel Stieglitz
>            Assignee: Daniel Stieglitz
>            Priority: Minor
>         Attachments: MySnmpAgent.java, TestSNMPV1AgentNew.java
>
>
> Currently the following warning is seen when building
> {code:java}
> [WARNING] nifi/nifi-extension-bundles/nifi-snmp-bund
> le/nifi-snmp-processors/src/test/java/org/apache/nifi/snmp/testagents/TestAgent.java:[42,40]
>  [deprecation] BaseAgent in org.snmp4j.agent has been deprecated{code}
> The aim of this ticket is to replace BaseAgent with the snmp4j API's 
> suggested replacement.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to