PennState / jms-tools

Apache License 2.0
3 stars 4 forks source link

The requestRetryThreshold has no default with isLoadFromProperties(false) #26

Closed smoyer64 closed 5 years ago

smoyer64 commented 5 years ago

When there's a network issue between k8s and either the CPR or the FPS LDAP servers, a ScimException is thrown and the message is supposed to be queued for retry as shown in the following code:

      } catch (ScimException e) {
        log.error(e.toString());
        UnableToProcessMessageException upme = new UnableToProcessMessageException(e.toString(), e);
        upme.setRetry(FIVE_MINUTE_RETRY);
        throw upme;
      }

Looking at a message that's supposed to be retried, we see the three log messages expected but we don't see the expected retries:

 13:39:31.663 [ID:wildfly-p02.ais.psu.edu-34961-1542746742093-302651:1:4787:1:1] [Thread-4] WARN  edu.psu.activemq.MessageProcessor - Error processing messageedu.psu.activemq.exception.UnableToProcessMessageException: ScimException(error=ErrorResponse(detail=Failed to connect to LDAP during user creation: , status=Internal Server Error, scimType=null, errorMessageList=null), status=Internal Server Error)
    at edu.psu.swe.fps.cpr.CprMessageProcessor.handleMessage(CprMessageProcessor.java:59)
    at edu.psu.activemq.MessageProcessor$1.run(MessageProcessor.java:170)
    at java.lang.Thread.run(Thread.java:748)
Caused by: edu.psu.swe.scim.spec.protocol.exception.ScimException: null
    at edu.psu.swe.fps.ldap.protocol.LdapServiceImpl.createUser(LdapServiceImpl.java:92)
    at edu.psu.swe.fps.ldap.FpsUserClientImpl.add(FpsUserClientImpl.java:32)
    at edu.psu.swe.fps.ldap.FpsUserClientImpl.addOrModify(FpsUserClientImpl.java:39)
    at edu.psu.swe.fps.FpsBusiness.upsert(FpsBusiness.java:35)
    at edu.psu.swe.fps.FpsBusiness.upsert(FpsBusiness.java:25)
    at edu.psu.swe.fps.cpr.CprMessageProcessor.handleMessage(CprMessageProcessor.java:50)
    ... 2 common frames omitted

13:39:31.663 [ID:wildfly-p02.ais.psu.edu-34961-1542746742093-302651:1:4787:1:1] [Thread-4] ERROR edu.psu.swe.fps.cpr.CprMessageProcessor - ScimException(error=ErrorResponse(detail=Failed to connect to LDAP during user creation: , status=Internal Server Error, scimType=null, errorMessageList=null), status=Internal Server Error)

13:39:31.661 [ID:wildfly-p02.ais.psu.edu-34961-1542746742093-302651:1:4787:1:1] [Thread-4] ERROR edu.psu.swe.fps.ldap.protocol.LdapServiceImpl - 500 (Internal Server Error) - Failed to connect to LDAP: org.apache.directory.api.ldap.model.exception.LdapEntryAlreadyExistsException: 
    at org.apache.directory.api.ldap.model.message.ResultCodeEnum.processResponse(ResultCodeEnum.java:2045)
    at org.apache.directory.ldap.client.api.LdapNetworkConnection.add(LdapNetworkConnection.java:979)
    at org.apache.directory.ldap.client.api.LdapConnectionWrapper.add(LdapConnectionWrapper.java:139)
    at edu.psu.swe.fps.ldap.protocol.LdapServiceImpl.createUser(LdapServiceImpl.java:76)
    at edu.psu.swe.fps.ldap.FpsUserClientImpl.add(FpsUserClientImpl.java:32)
    at edu.psu.swe.fps.ldap.FpsUserClientImpl.addOrModify(FpsUserClientImpl.java:39)
    at edu.psu.swe.fps.FpsBusiness.upsert(FpsBusiness.java:35)
    at edu.psu.swe.fps.FpsBusiness.upsert(FpsBusiness.java:25)
    at edu.psu.swe.fps.cpr.CprMessageProcessor.handleMessage(CprMessageProcessor.java:50)
    at edu.psu.activemq.MessageProcessor$1.run(MessageProcessor.java:170)
    at java.lang.Thread.run(Thread.java:748)
pike1212 commented 5 years ago

Are you overriding the broker.retry.threshold env var? It should default to 3 if not provided.

smoyer64 commented 5 years ago

Not in the FPS project ... I'll have to check to see if the CDI changes I made are overriding it.

pike1212 commented 5 years ago

You could try updating to latest version of this library, but the logic should be the same

smoyer64 commented 5 years ago

If you build the MessageHandler is built via the MessageHandlerFactory with isLoadFromProperties(false) the default value is (implicitly) set to zero.