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

21st
Feb 2018
Jagmohan Sharma
@JagmohanSharma
Feb 21 2018 02:45
okk. I see. this is why it is not able to find the accurate key while unbinding resources.
Thank you so much for this finding. I will try switching off JPA auto config and update on issue.
Tyler Van Gorder
@tkvangorder
Feb 21 2018 04:15
@khoubyari I have not used any of the Kubernetes Spring infrastructure, but looking at the auto configuration in that project: See source here Looks like you could just disable the kubernetes config in a similar manner. Keep in mind, if you are including other spring-kubernetes projects, they may have auto configuration as well. You can look in each projects /src/resources/META-INF/spring.factories to see which configurations are being picked up by auto-configuration.
ghoddg
@ghoddg
Feb 21 2018 05:42
@dsyer , @spencergibb I want to understand the Spring Integration. Can you please suggest me some links which i should go through or any github project for reference?
Jagmohan Sharma
@JagmohanSharma
Feb 21 2018 09:20
@dsyer One more thing I found that, incase if I switch off jpa Auto config HibernateJpaAutoConfiguration then we also would not be able to use JpaRepositoryas well ?
Dave Syer
@dsyer
Feb 21 2018 09:21
Correct
You need a JpaTransactionManager
and the autoconfig for repositories
There are sample in the interweb showing you how to use multiple EntityManagers.
It's going to mean a lot more code for you.
I'd seriously be questioning if it was worth it, if I were you.
Jagmohan Sharma
@JagmohanSharma
Feb 21 2018 09:36
Sure I will definitely put this word forward to question its worth.
One more help regarding this approach i seek, which is related to DataSourcesHealthIndicatorConfiguration as these property based created data source beans are not getting available to health indicator
Dave Syer
@dsyer
Feb 21 2018 09:49
I guess you have to create those as well if you need them
Jagmohan Sharma
@JagmohanSharma
Feb 21 2018 09:52
I did not get. Means we have to create them using @Configuration only? Or we have to create dbHealthIndicator() by passing these beans explicitly?
pascalwilbrink
@pascalwilbrink
Feb 21 2018 15:00

Hi, i'm having trouble with sending refresh events through the AMQP bus. i think it's a configuration issue. i have the following:

Config server, annotated correctly. uses local filesystem as storage. port 8888
Config client, annotated correctly. can connect to Config server. port 1111

When i update a yml file, the config server sees the changes (by accessing the url) but wont send them through the bus.
I have to call the /bus/refresh endpoint on the Server to see the changes in the client.

my properties:

Server (Application.yml)

  port: 8888

spring:
  application:
    name: config
  profiles:
    active: native
  cloud:
    config:
      server:
        native:
          failFast: true
  rabbitmq:
    host: localhost
    port: 5672
    username: guest
    password: guest

logging:
  level:
    root: INFO
    org:
      springframework:
        web: INFO

management:
  security:
    enabled: false

Client(Application.yml):

spring:
  application:
    name: client
  profiles:
    active: dev
  rabbitmq:
    host: localhost
    port: 5672
    username: guest
    password: guest

server:
  port: 1111

logging:
  level:
    root: INFO
    org:
      springframework:
        web: INFO

management:
  security:
    enabled: false

Client(bootstrap.yml)

spring:
  profiles:
    active: dev
  cloud:
    config:
      enabled: true
      uri: http://localhost:8888

What am i doing wrong?

Dave Syer
@dsyer
Feb 21 2018 15:33
Probably nothing. Sounds like it's behaving as expected.
There's no file watcher by default
pascalwilbrink
@pascalwilbrink
Feb 21 2018 15:34
I thought that there was a watcher on the configuration files?
Dave Syer
@dsyer
Feb 21 2018 15:34
You could try adding the monitor
pascalwilbrink
@pascalwilbrink
Feb 21 2018 15:34
ok, is there a way i can turn it on?
I already have the dependency in the ConfigServer
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-config-monitor</artifactId>
    </dependency>
Dave Syer
@dsyer
Feb 21 2018 15:36
Don't know then
There's a bus running as well for sure?
pascalwilbrink
@pascalwilbrink
Feb 21 2018 15:36
yes
when i call this endpoint: curl -X POST http://localhost:8888/bus/refresh, the ConfigServer updates the client
Dave Syer
@dsyer
Feb 21 2018 15:37
OK
pascalwilbrink
@pascalwilbrink
Feb 21 2018 15:37
btw, the config files are outside of my Jar file
Dave Syer
@dsyer
Feb 21 2018 15:37
What version of Spring Cloud?
pascalwilbrink
@pascalwilbrink
Feb 21 2018 15:37
Edgware.SR2
Dave Syer
@dsyer
Feb 21 2018 15:37
Maybe the watch is on the wrong files?
There's probably some logging
pascalwilbrink
@pascalwilbrink
Feb 21 2018 15:38
i'll turn it on
Dave Syer
@dsyer
Feb 21 2018 15:38
You should see INFO logging already if you have the default log config
FileMonitorConfiguration tells you where it is watching when it starts
pascalwilbrink
@pascalwilbrink
Feb 21 2018 15:51
Not monitoring for local config changes
that's the problem
pascalwilbrink
@pascalwilbrink
Feb 21 2018 16:12

@dsyer, if i don't specify my searchLocations, it will use the defaults, private static final String[] DEFAULT_LOCATIONS = new String[] { "classpath:/",
"classpath:/config/", "file:./", "file:./config/" };

But the fileMonitor looks for the specific searchLocations (no fallback to the defaults if the searchLocations are empty)

is this intended?
Dave Syer
@dsyer
Feb 21 2018 16:36
NativeEnvironmentRepository isn't really "production grade"
Probably it wasn't included when we did the file watcher
Just use a local git repository. That should work.
pascalwilbrink
@pascalwilbrink
Feb 21 2018 16:37
i'll try that. Thanks