Note I am using the Java client in Scala. case class
annotations are slightly different. I have the following POJO:
case class User(
@(JsonProperty@field)("guid")
@(RiakKey@field)
val guid: String,
@(JsonProperty@field)("email")
@(JsonSerialize@field)(using=classOf[util.serialization.StringToUrlSerializer])
@(JsonDeserialize@field)(using=classOf[util.serialization.StringToUrlDeserializer])
@(RiakIndex@field)(name = "email")
val email: String,
@(JsonProperty@field)("passwordHash")
val passwordHash: String
)
Suddenly, Riak stopped storing a secondary index for my User
. We can still create secondary indexes manually if we use the raw HTTP API via a REST client but in the code I am at a loss to explain why it is failing.
Here is how we store Riak Objects:
/**
* Riak database operations
*/
val bucketName = "accounts-user"
val bucket = DB.client.createBucket(bucketName).enableForSearch().execute()
val converter = {
val c = new JSONConverter[User](classOf[User], bucketName)
c.getObjectMapper().registerModule(DefaultScalaModule)
c
}
def store(o: User) = bucket.store(o).withConverter(converter).withRetrier(DB.retrier).execute()
The Jackson imports we're using are as follows:
import com.fasterxml.jackson.annotation._
import com.fasterxml.jackson.databind.annotation._
import com.fasterxml.jackson.module.scala._
The objects are being stored successfully and errors are not being thrown. What might be the cause to the issue? Does the DefaultScalaModule
for Jackson possibly interfere with annotations? FYI I did try removing the custom converter but it did not solve the issue (did not remove any Scala Module imports, however). Thanks.
Edit
Possibly related: recently we started proxying Riak via NGINX. Do I need to do both HTTP and TCP proxy_pass
?