Setting JNDI property for Mobile Analytics Time To Live(TTL) value as days in Liberty Profile

Problem Description

Error seen when the time-to-live value (TTL) for MobileFirst Analytics documents is set with the unit of “days”. For example, when we set 90d for 90days in the JNDI value, it fails.

Setting TTL for MfpAppLogs in MobileFirst Analytics Server as below

<jndiEntry jndiName="analytics/TTL_MfpAppLogs" value="90d" />

throws following error: E MSAN219E: Setting for TTL: MfpAppLogs has been set to an invalid TTL string.
org.elasticsearch.ElasticsearchParseException: Failed to parse [90.0]

Version impacted: IBM MobileFirst Analytics Server 7.1

Cause :

As per the details provided in Liberty documentation, jndiEntry for string literals is expected to be enclosed with single quotes. Without a single quote the value passed as a numeral followed by ‘d’ (eg: 90d) is assumed as double-precision floating point (i.e 90.0) by the Liberty Server.

Resolution :

  • jndiEntry for TTL values are expected to be String literals.
  • As per Liberty documentation TTL value should be passed with in single quotes.
  • For example, setting TTL for MfpAppLogs in MobileFirst Analytics Server, it should look as follows (note the additional single quotes):

<jndiEntry jndiName="analytics/TTL_MfpAppLogs" value='"90d"' />

Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.
Last modified on July 04, 2017