You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/07/31 10:30:39 UTC

[GitHub] [camel-k] pjcubero commented on issue #1649: Caffeine with Knative doesn't work

pjcubero commented on issue #1649:
URL: https://github.com/apache/camel-k/issues/1649#issuecomment-667053642


   Ok, this example is not working for me:
   
   public class getTokenextends RouteBuilder {
   
     @BindToRegistry
     public static Cache<String, String> cache() {
       return Caffeine.newBuilder()
       .expireAfterWrite(10, TimeUnit.SECONDS)
       .maximumSize(100)
       .build();
     }	
     
     @Override
     public void configure() throws Exception {
   
       from("knative:endpoint/get-token")
   		.to("caffeine-cache://ejemplo?cache=#cache&action=GET&key=token")
   		.log("Result of Action ${header.CamelCaffeineAction} with key ${header.CamelCaffeineKey} is: ${body}")
   
   
   But this is working fine for me:
   
   public class EjemploCache extends RouteBuilder {
   	@Override
   	public void configure() throws Exception {
   		from("timer:tick")
   			.setBody(constant("Hello"))
   			.setHeader("CamelCaffeineAction", constant("PUT"))
   			.setHeader("CamelCaffeineKey", constant("1"))
   			.toF("caffeine-cache://%s", "test")
   			.log("Result of Action ${header.CamelCaffeineAction} with key ${header.CamelCaffeineKey} is: ${body}")


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org