Configuring msgMaxSize of SNMPv3 polling requests

We have implemented a microservice providing SNMP polling functionality employing the SNMP4J library (paid licensed version).
No a client has approached us with a new use case: He would like to configure the msgMaxSize parameter (see RFC3412) of the outgoing SNMPv3 polling packets.
By default it seems to be set to 65535.

I could not find any information about this in the documentation. Furthermore I now have spent a significant amount of time examining the source code and investigating possibilities. While I did find some occurrences where this parameter is passed, I could not find an interface where I can hook into this process.

Is it somehow possible to configure the msgMaxSize parameter of outgoing polling requests? It would indeed be an important aspect for our usage.
If yes, could you explain us how?

Thank you very much for your response in advance!

You can use DefaultUdpTransportMapping.setMaxInboundMessageSize to set that value on transport level. DTLSM, TLSM and DefaultTcpTransportMapping have this method too.

1 Like

Works like a charm, thank you!