These are chat archives for spring-cloud/spring-cloud

26th
Oct 2016
Włodzimierz Rożkow
@rozhok
Oct 26 2016 07:58
hey guys, how to configure Arachaius using Spring Boot? I need to setup dynamodb endpoint and table name.

Spring Cloud has a Spring Environment Bridge so Archaius can read properties from the Spring Environment.

How the properties should be named?
I need to set up com.netflix.config.dynamo.endpoint but it isn't readed by Archaius, it fallbacks to default

Dave Syer
@dsyer
Oct 26 2016 08:00
There's no direct support for a dynamo backend
You could provide it using a custom property source locator I suppose
We only support archaius on the client side
Stian Lågstad
@stianlagstad
Oct 26 2016 08:03
Hi. What could I have done wrong when curl http://localhost:9994/hystrix.stream does not return a stream, but returns the html page usually located at http://localhost:9994/hystrix?
Włodzimierz Rożkow
@rozhok
Oct 26 2016 08:05
@dsyer I understrand that, so what I did is:
@Bean
public AbstractConfiguration archaiusConfiguration() {
    DynamoDbConfigurationSource source = new DynamoDbConfigurationSource(aws.dynamoDbClient());
    FixedDelayPollingScheduler scheduler = new FixedDelayPollingScheduler(0, 5000, false);
    return new DynamicConfiguration(source, scheduler);
}
then I need to configure DynamoDbConfigurationSource, It reads properties like table name and other stuff from following properties
String tablePropertyName = "com.netflix.config.dynamo.tableName";
String keyAttributePropertyName = "com.netflix.config.dynamo.keyAttributeName";
String valueAttributePropertyName = "com.netflix.config.dynamo.valueAttributeName";
is there way to set this properties somehow?
it then tries to retrieve them like
protected DynamicStringProperty tableName = DynamicPropertyFactory.getInstance()
        .getStringProperty(tablePropertyName, defaultTable);
Stian Lågstad
@stianlagstad
Oct 26 2016 08:06
The url http://localhost:9994/hystrix/monitor?stream=http%3A%2F%2Flocalhost%3A9994%2Fhystrix.stream (which I have bookmarked) shows me the hystrix dashboard with the error message Unable to connect to Command Metric Stream..
Dave Syer
@dsyer
Oct 26 2016 08:17
@stianlagstad looks like you managed to switch off or mask the handler mapping for the stream
IIRC it's an actuatir endpoint. If that helps.
A simple sample would be really easy to analyse.
Stian Lågstad
@stianlagstad
Oct 26 2016 08:18
Thanks Dave! I'll work on reproducing it
Dave Syer
@dsyer
Oct 26 2016 08:18
@rozhok you mean you want to read the dynamodb props from Archauis?
I guess that should work, as long as the classpath has all the bits you need, it would show up in the Spring Environment (and you would see it in the /env endpoint of your app, for instance)
Włodzimierz Rożkow
@rozhok
Oct 26 2016 08:19
@dsyer no, I want to read dynamic properties from DynamoDB using Arcahius. I want to use Dynamo as properties storage.
to do this I have to provide Properties source as described above
I am able to read properties using default DynamoDB endpoint, table and column names
Dave Syer
@dsyer
Oct 26 2016 08:21
I guess there's some kind of bootstrap problem then? Which one comes first, archaius or dynamo?
Włodzimierz Rożkow
@rozhok
Oct 26 2016 08:21
What I want to achieve is configure Archaius so it will read properties from my table
dynamo
Dave Syer
@dsyer
Oct 26 2016 08:21
Sounds like nothing to do with Spring then?
Włodzimierz Rożkow
@rozhok
Oct 26 2016 08:21
ugh
no
I want to configure Arcahius
there is AbstractDynamoDbConfigurationSource class in NetFlix sources
it has property called
static final String tablePropertyName = "com.netflix.config.dynamo.tableName";
then it reads it
protected DynamicStringProperty tableName = DynamicPropertyFactory.getInstance()
        .getStringProperty(tablePropertyName, defaultTable);
what I asking
How to provide the value of this property
com.netflix.config.dynamo.tableName

Because spring-cloud-docs says

Spring Cloud has a Spring Environment Bridge so Archaius can read properties from the Spring Environment. This allows Spring Boot projects to use the normal configuration toolchain, while allowing them to configure the Netflix tools, for the most part, as documented.

Dave Syer
@dsyer
Oct 26 2016 08:24
Well, Spring Cloud would make that property readable from the Spring Environment as advertised.
Włodzimierz Rożkow
@rozhok
Oct 26 2016 08:24
okay
Dave Syer
@dsyer
Oct 26 2016 08:24
If it doesn't work, my guess is a lifecycle issue (since you want to use it to configure archaius itself).
Włodzimierz Rożkow
@rozhok
Oct 26 2016 08:25
what's the way to set this property to Spring Environment? Maybe manually?
Dave Syer
@dsyer
Oct 26 2016 08:25
application.properties is the normal way
Archaius is a singleton pig though. It might fight you. You will get dirty.
Włodzimierz Rożkow
@rozhok
Oct 26 2016 08:26
okay, so I should have property like
com:
  netflix:
    config:
...
yes?
and probably this thing would work
Dave Syer
@dsyer
Oct 26 2016 08:28
It would work
I'm just not sure about using it to configure archaius itself
Włodzimierz Rożkow
@rozhok
Oct 26 2016 08:29
well, it's not working so as you mentioned there is LifeCycle issue somewhere
thanks
Stian Lågstad
@stianlagstad
Oct 26 2016 08:37
@dsyer It was my own fault. I had set management.context-path in my config without thinking that it would change the /hystrix.stream url
Thanks again
Stian Lågstad
@stianlagstad
Oct 26 2016 08:44
Another thing: According to http://cloud.spring.io/spring-cloud-netflix/spring-cloud-netflix.html I should get information about the circuitbreaker when I call /health, but I don't. Is there something I have to do to enable that?
Dave Syer
@dsyer
Oct 26 2016 08:54
No. It should be there I think. Haven't checked recently.
What do you see in /health?
Stian Lågstad
@stianlagstad
Oct 26 2016 08:55
{
  "status": "UP"
}
Stian Lågstad
@stianlagstad
Oct 26 2016 11:30
Will the threads created by hystrix stay alive as long as the application runs? If so: Can I make them not stay alive? I set the hystrix.threadpool.default.coreSize: 100 for an app I have , and under a perfomance test I see that the limit of hystrix client threads is reached, and it looks like they stay there after the test is done.
Dave Syer
@dsyer
Oct 26 2016 12:09
That /health looks like a normal one in a secure app
Henning Hoefer
@hho
Oct 26 2016 14:53
Hi. I'm trying to do leader election with Zookeeper – I found spring-cloud-cluster, but it's deprecated in favor of Spring Integration. Is there any example how to do this?
Stian Lågstad
@stianlagstad
Oct 26 2016 15:00
Ah, so I should not see the circuitbreaker information if the app is secure?
Karthikeyan Palanivelu
@pckeyan
Oct 26 2016 15:56

Hi, I am working on a Http Source and Mongo Sink with Rabbit as Binder using SpringCloudStream and Spring Cloud App Starters. I manage to get this working on a concurrency to faster read and insert to Mongo. But if I need to have more instance count, I am using below properties to bind to same topic:

spring.cloud.stream.instanceCount=3
spring.cloud.stream.instanceIndex=${instance.index}
spring.cloud.stream.binder.rabbit.default.prefix=z.
spring.cloud.stream.bindings.input.destination=eml-ob-http-source
spring.cloud.stream.bindings.input.group=default

When I start same boot app as two instances by passing instance.index as 0 and 1 from CMD line, they both read data from same queue and is slower in nature to one consumer. Can you please guide me here how to get twice the performance to running as one instance?

Thanks
Karthik