@Override public HystrixObservableCommand.Setter create(Target<?> target, MethodMetadata methodMetadata) { String groupKey = target.name(); String commandKey = methodMetadata.configKey(); return HystrixObservableCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); } }
@Override public HystrixObservableCommand.Setter create(Target<?> target, MethodMetadata methodMetadata) { String groupKey = target.name(); String commandKey = methodMetadata.configKey(); return HystrixObservableCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); } }
@Override public HystrixObservableCommand.Setter create(Target<?> target, MethodMetadata methodMetadata) { String groupKey = target.name(); String commandKey = methodMetadata.configKey(); return HystrixObservableCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); } }
@Override public HystrixCommand.Setter create(Target<?> target, Method method) { String groupKey = target.name(); String commandKey = Feign.configKey(target.type(), method); return HystrixCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); } }
@Test public void init_NoNameGiven_ShouldDeriveNameFromType() { Target<ApiInterface1> target = new LambdaServiceFunctionTarget<>(ApiInterface1.class); assertEquals("lambda service: ApiInterface1", target.name()); }
@Override public HystrixCommand.Setter create(Target<?> target, Method method) { String groupKey = target.name(); String commandKey = Feign.configKey(target.type(), method); return HystrixCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandPropertiesDefaults(HystrixCommandProperties.Setter() .withExecutionTimeoutInMilliseconds(timeout) .withExecutionIsolationSemaphoreMaxConcurrentRequests(connections)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); } };
@Test public void testGetters() { Target<ApiInterface1> target1 = new LambdaServiceFunctionTarget<>(ApiInterface1.class, "a"); assertEquals("a", target1.name()); assertEquals(ApiInterface1.class, target1.type()); assertEquals("", target1.url()); Target<ApiInterface2> target2 = new LambdaServiceFunctionTarget<>(ApiInterface2.class, "b"); assertEquals("b", target2.name()); assertEquals(ApiInterface2.class, target2.type()); assertEquals("", target2.url()); }