profile
viewpoint
Mark Paluch mp911de Pivotal Software, Inc. Weinheim, Germany http://www.paluch.biz Finest hand-crafted software. Spring Data Project Lead @pivotal, Lettuce Redis Driver Lead. Open source and computers.

lettuce-io/lettuce-core 3521

Advanced Java Redis client for thread-safe sync, async, and reactive usage. Supports Cluster, Sentinel, Pipelining, and codecs.

mp911de/logstash-gelf 347

Graylog Extended Log Format (GELF) implementation in Java for all major logging frameworks: log4j, log4j2, java.util.logging, logback, JBossAS7 and WildFly 8-12

mp911de/CleanArchitecture 194

CleanArchitecture Example

mp911de/atsoundtrack 27

IntelliJ IDEA Plugin providing @soundtrack

mp911de/iot-distancemeter 19

Transmit sonic sensor data using RaspberryPi/Logstash/MQTT/Python

mp911de/configurator-maven-plugin 3

Home of the configurator-maven-plugin.

mp911de/akka-actor-statistics 2

Pulls statistics (mailbox sizes/processing times) from Akka Actors

mp911de/CCD 2

Clean Code Examples

issue closedspring-cloud/spring-cloud-vault

spring-cloud-starter-vault-config:2.2.3.RELEASE doesn't work with spring-cloud-starter-netflix-eureka-client:2.2.3.RELEASE

EDIT: before you ask, YES, I changed my password to get rid of the embedded @ :) to eliminate that as the issue.

I have a project, where I have it set up as eureka first, so both the vault bootstrap and config bootstrap go through eureka. It works great with:

spring-cloud-starter-netflix-eureka-client:2.2.2.RELEASE
org.springframework.cloud:spring-cloud-starter-config:2.2.3.RELEASE
spring-cloud-starter-vault-config:2.2.3.RELEASE

When I upgrade to eureka client 2.2.3.RELEASE, I get the following exception (NOTE: Spring Cloud Config 2.2.3 in the bootstrap and works fine with eureka client 2.2.3, only the vault bootstrap 2.2.3 doesn't):

Description:

Parameter 0 of method vaultServerInstanceProvider in org.springframework.cloud.vault.config.DiscoveryClientVaultBootstrapConfiguration required a bean of type 'org.springframework.cloud.client.discovery.DiscoveryClient' that could not be found.


Action:

Consider defining a bean of type 'org.springframework.cloud.client.discovery.DiscoveryClient' in your configuration.

2020-06-26 12:25:49.069 ERROR 6788 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.vault.config.VaultReactiveBootstrapConfiguration': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.vault.config.VaultReactiveBootstrapConfiguration]: Constructor threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'vaultEndpointProvider' defined in class path resource [org/springframework/cloud/vault/config/DiscoveryClientVaultBootstrapConfiguration.class]: Unsatisfied dependency expressed through method 'vaultEndpointProvider' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'vaultServerInstanceProvider' defined in class path resource [org/springframework/cloud/vault/config/DiscoveryClientVaultBootstrapConfiguration.class]: Unsatisfied dependency expressed through method 'vaultServerInstanceProvider' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.cloud.client.discovery.DiscoveryClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:313) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:294) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1358) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:893) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
	at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:212) ~[spring-cloud-context-2.2.3.RELEASE.jar:2.2.3.RELEASE]
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:117) ~[spring-cloud-context-2.2.3.RELEASE.jar:2.2.3.RELEASE]
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:74) ~[spring-cloud-context-2.2.3.RELEASE.jar:2.2.3.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:80) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
	at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:53) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
	at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:345) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
	at org.xxx.xxx.test.xxxTestApplication.main(xxxTestApplication.java:26) ~[main/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.vault.config.VaultReactiveBootstrapConfiguration]: Constructor threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'vaultEndpointProvider' defined in class path resource [org/springframework/cloud/vault/config/DiscoveryClientVaultBootstrapConfiguration.class]: Unsatisfied dependency expressed through method 'vaultEndpointProvider' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'vaultServerInstanceProvider' defined in class path resource [org/springframework/cloud/vault/config/DiscoveryClientVaultBootstrapConfiguration.class]: Unsatisfied dependency expressed through method 'vaultServerInstanceProvider' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.cloud.client.discovery.DiscoveryClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:217) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:309) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	... 29 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'vaultEndpointProvider' defined in class path resource [org/springframework/cloud/vault/config/DiscoveryClientVaultBootstrapConfiguration.class]: Unsatisfied dependency expressed through method 'vaultEndpointProvider' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'vaultServerInstanceProvider' defined in class path resource [org/springframework/cloud/vault/config/DiscoveryClientVaultBootstrapConfiguration.class]: Unsatisfied dependency expressed through method 'vaultServerInstanceProvider' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.cloud.client.discovery.DiscoveryClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:797) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:538) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1304) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory$DependencyObjectProvider.getIfAvailable(DefaultListableBeanFactory.java:1939) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.cloud.vault.config.VaultReactiveBootstrapConfiguration.<init>(VaultReactiveBootstrapConfiguration.java:106) ~[spring-cloud-vault-config-2.2.3.RELEASE.jar:2.2.3.RELEASE]
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:204) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	... 31 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'vaultServerInstanceProvider' defined in class path resource [org/springframework/cloud/vault/config/DiscoveryClientVaultBootstrapConfiguration.class]: Unsatisfied dependency expressed through method 'vaultServerInstanceProvider' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.cloud.client.discovery.DiscoveryClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:797) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:538) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1304) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1224) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:884) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	... 49 common frames omitted
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.cloud.client.discovery.DiscoveryClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1714) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1270) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1224) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:884) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	... 63 common frames omitted

closed time in 29 minutes

SledgeHammer01

issue commentspring-cloud/spring-cloud-vault

spring-cloud-starter-vault-config:2.2.3.RELEASE doesn't work with spring-cloud-starter-netflix-eureka-client:2.2.3.RELEASE

I'm not sure whether the bootstrap config was removed/disabled in a service release. In any case closing since the issue was resolved.

SledgeHammer01

comment created time in 30 minutes

push eventspring-projects/spring-data-cassandra

Mark Paluch

commit sha 244f4f9a00b9de5d2b118f85369ec12e4b5871c3

DATACASS-807 - Polishing. Fix typo in test method name.

view details

push time in 2 hours

push eventspring-projects/spring-data-commons

Mark Paluch

commit sha d10560f2388e5f4263efa23e9fadc73ffab9ed24

DATACMNS-1762 - Reintroduce calls to ReactiveWrapperConverters.supports(…) after decoupling from QueryExecutionConverters. We now consider reactive wrapper types in all areas that previously relied on QueryExecutionConverters to handle reactive type information correctly. Specifically, we call supports(…) and perform type unwrapping to ensure to detect the correct return type.

view details

push time in 2 hours

push eventspring-projects/spring-data-elasticsearch

Mark Paluch

commit sha a4c1505bece05f2b6664536fc64785179774426d

DATAES-938 - Fix collection query detection in ReactiveElasticsearchQueryMethod. isCollectionQuery() now correctly identifies if a query should return more than one result.

view details

push time in 3 hours

push eventspring-projects/spring-data-cassandra

Mark Paluch

commit sha 35e9d98ba14778646286fb72cc58ddbc8503d582

DATACASS-807 - Adapt to changes in Spring Data Commons.

view details

push time in 3 hours

push eventmp911de/spring-boot-virtual-threads-experiment

Mark Paluch

commit sha b6eebfeb8377aca2d79b2e556e30fba91108a8a4

Initial commit

view details

push time in 3 hours

push eventspring-projects/spring-data-commons

Mark Paluch

commit sha 5876bd2e5ac546404a98563db9039283dcd0e2a7

DATACMNS-1762 - Consider reactive types as wrappers during method introspection. We now perform type unwrapping and introspection for reactive types for method return types and method arguments after decoupling QueryExecutionConverters.supports(…) from ReactiveWrapperConverters.

view details

push time in 4 hours

create barnchmp911de/spring-boot-tomcat-virtual-threads-experiment

branch : master

created branch time in 4 hours

created repositorymp911de/spring-boot-tomcat-virtual-threads-experiment

Project Loom Experiment using Spring Boot, Spring WebMVC, and Postgres

created time in 4 hours

issue commentspring-cloud/spring-cloud-vault

spring-cloud-starter-vault-config:2.2.3.RELEASE doesn't work with spring-cloud-starter-netflix-eureka-client:2.2.3.RELEASE

The required Bootstrap imports are:

org.springframework.cloud.bootstrap.BootstrapConfiguration=org.springframework.cloud.netflix.eureka.EurekaDiscoveryClientConfiguration,org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration,org.springframework.cloud.netflix.eureka.config.DiscoveryClientOptionalArgsConfiguration

Specifically, the package of EurekaDiscoveryClientConfiguration (org.springframework.cloud.eureka.discovery vs org.springframework.cloud.netflix.eureka) does not match.

With that change in place, the discovery client gets started up properly. Since this change works for me, I'm inclined to close this ticket. Can you let us know whether this configuration works for you, too?

SledgeHammer01

comment created time in 9 hours

issue commentspring-projects/spring-framework

TransactionalEventListener not working for Webflux applications with Reactive Mongodb

Duplicate of https://jira.spring.io/browse/DATAMONGO-2632.

Reactive event listeners do not participate in the transaction that published the event because there's no mechanism to propagate the transaction context to ApplicationEventMulticaster. Any component that wants to participate in the Reactor Context (holding contextual details) must return a Publisher type. ApplicationEventPublisher.publishEvent(…) returns void hence there's no way how this invocation could get hold of the Reactor Context.

codependent

comment created time in a day

push eventspring-cloud/spring-cloud-vault

Mark Paluch

commit sha 3349c814a23eee1bef14e577ce5c517884333556

Polishing Switch AwsEc2Properties.identityDocument to URI. Reorder property accessors. Tweak documentation formatting. Original pull request: gh-495. Resolves gh-451.

view details

push time in a day

push eventspring-cloud/spring-cloud-vault

infa-szhong

commit sha f95fea8e9210069389bf18c7c97186f542f00eef

Make Azure auth metadata URIs configurable Original pull request: gh-495 See gh-451

view details

Mark Paluch

commit sha 30df89492692308f9914d3976e51509a7238afb6

Polishing Switch AwsEc2Properties.identityDocument to URI. Reorder property accessors. Tweak documentation formatting. Original pull request: gh-495. Resolves gh-451.

view details

push time in a day

issue closedspring-cloud/spring-cloud-vault

Azure Authentication - Configurable Resource ID

Hi,

It looks like for Azure MSI Authentication, Spring requests the JWT token from this URL: "http://169.254.169.254/metadata/identity/oauth2/token?resource=https://vault.hashicorp.com&api-version=2018-02-01". It seems that this is not configurable.

Would it be possible to make the Vault resource ID parameter configurable to something other than the value "https://vault.hashicorp.com"? This might be needed in the case of having multiple Vault resources as their IDs must be unique.

closed time in a day

infa-szhong

PR closed spring-cloud/spring-cloud-vault

Changes for Issue #451 to make more Azure auth properties configurable type: enhancement
  • Added some fields in VaultProperties.java: AzureMsiProperties.identityTokenService and AzureMsiProperties.metadataService. Used these names to follow conventions set here. Defaults remain the same.
  • In ClientAuthenticationFactory.java, when building AzureMsiAuthenticationOptions, use those properties.
  • Updated docs to indicate the ability to set spring.cloud.vault.azure-msi.metadata, spring.cloud.vault.azure-msi.identity-token-service
+39 -3

1 comment

3 changed files

infa-szhong

pr closed time in a day

pull request commentspring-cloud/spring-cloud-vault

Changes for Issue #451 to make more Azure auth properties configurable

Thank you for your contribution. That's merged and polished now.

infa-szhong

comment created time in a day

Pull request review commentspring-projects/spring-vault

Adding support of KV Patch operation

 public void put(String path, Object body) { 		doWrite(createDataPath(path), Collections.singletonMap("data", body)); 	} +	/**+	 * Performs a KV Patch operation.+	 * @param path must not be {@literal null} or empty.+	 * @param kv New key value map to be updated+	 * @since 2.3+	 */+	public void patch(String path, Map<String, ?> kv) {+		Assert.hasText(path, "Path must not be empty");++		// To do patch operation, we need to do a read operation first+		VaultResponse readResponse = get(path);+		Assert.notNull(readResponse, "VaultResponse must not be null");

If the secret doesn't exist, a meaningful exception should be thrown. I think a new SecretNotFoundException type (extends VaultException) would make sense.

yfaney

comment created time in a day

Pull request review commentspring-projects/spring-vault

Adding support of KV Patch operation

 public void put(String path, Object body) { 		doWrite(createDataPath(path), Collections.singletonMap("data", body)); 	} +	/**+	 * Performs a KV Patch operation.+	 * @param path must not be {@literal null} or empty.+	 * @param kv New key value map to be updated+	 * @since 2.3+	 */+	public void patch(String path, Map<String, ?> kv) {+		Assert.hasText(path, "Path must not be empty");++		// To do patch operation, we need to do a read operation first+		VaultResponse readResponse = get(path);+		Assert.notNull(readResponse, "VaultResponse must not be null");+		Assert.notNull(readResponse.getData(),+				String.format("No data found at %s; patch only works on existing data", path));+		Assert.notNull(readResponse.getMetadata(), "Metadata must not be null");+		Map<String, Object> data = readResponse.getData();+		Map<String, Object> metadata = readResponse.getMetadata();+		kv.forEach(data::put);+		Map<String, Object> body = new HashMap<>();+		body.put("data", data);+		body.put("options", Collections.singletonMap("cas", metadata.get("version")));++		doWrite(createDataPath(path), body);

There should be also a reaction on whether the write was successful. A concurrent process could have updated the secret in the meantime. Returning true on success (similar to Java's compareAndSet methods in the concurrency util package) would make sense.

yfaney

comment created time in a day

Pull request review commentspring-projects/spring-vault

Adding support of KV Patch operation

 		super("versioned", KeyValueBackend.versioned()); 	} +	@Test+	void shouldPatchSecret() {+		final String oldKey = "key";+		final String newKey = "newKey";+		Map<String, String> secret = Collections.singletonMap(oldKey, "value");++		String key = UUID.randomUUID().toString();++		this.kvOperations.put(key, secret);++		Map<String, String> newSecret = Collections.singletonMap(newKey, "newValue");++		((VaultKeyValue2Template) this.kvOperations).patch(key, newSecret);

Once the patch method gets exposed through VaultKeyValueOperations, there's no need to have the downcast.

yfaney

comment created time in a day

Pull request review commentspring-projects/spring-vault

Adding support of KV Patch operation

 public void put(String path, Object body) { 		doWrite(createDataPath(path), Collections.singletonMap("data", body)); 	} +	/**+	 * Performs a KV Patch operation.+	 * @param path must not be {@literal null} or empty.+	 * @param kv New key value map to be updated+	 * @since 2.3+	 */+	public void patch(String path, Map<String, ?> kv) {

This operation should be also provided for the version 1 backend. Since this class is package-protected, there's no way to consume this method. Therefore, the method should be also made available in the VaultKeyValueOperations interface.

yfaney

comment created time in a day

PullRequestReviewEvent
PullRequestReviewEvent

push eventspring-cloud/spring-cloud-vault

Mark Paluch

commit sha 9b5ea839182d47211e6ed2d5ad9510435033978f

Add support for ReactiveDiscoveryClient ReactiveDiscoveryClient beans are now used to configure ReactiveVaultEndpointProvider. If no ReactiveDiscoveryClient is available, then VaultEndpointProvider gets adapted by offloading the call to a worker Scheduler to avoid blocking calls on the calling thread. Resolves gh-486.

view details

push time in a day

issue closedspring-cloud/spring-cloud-vault

Add support for ReactiveDiscoveryClient

With the introduction of ReactiveVaultEndpointProvider, we can support reactive discovery clients.

closed time in a day

mp911de

push eventspring-cloud/spring-cloud-vault

Mark Paluch

commit sha 09727718cbcb188b72994b7ca033e08d56e21c5e

Annotate API with Spring's @NonNullApi/@Nullable to indicate null/non-null rules Closes gh-494.

view details

Mark Paluch

commit sha 872c96950668c470df04e9125d5480249eb4daa8

Polishing Replace VaultRabbitMqProperties bean with @EnableConfigurationProperties(VaultRabbitMqProperties.class). See gh-494.

view details

push time in a day

issue closedspring-cloud/spring-cloud-vault

Annotate API with Spring's @NonNullApi/@Nullable to indicate null/non-null rules

We should annotate our API with @NonNullApi/@Nullable to indicate nullability rules.

closed time in a day

mp911de

issue openedspring-cloud/spring-cloud-vault

Annotate API with Spring's @NonNullApi/@Nullable to indicate null/non-null rules

We should annotate our API with @NonNullApi/@Nullable to indicate nullability rules.

created time in a day

issue commentlettuce-io/lettuce-core

Suggestion: clarify documentation about `multi` in reactive/async environments.

FWIW, the docs (https://github.com/lettuce-io/lettuce-core/wiki) start with connection sharing limits. We should add the note to the transaction chapter (https://github.com/lettuce-io/lettuce-core/wiki/Transactions).

max-grigoriev

comment created time in a day

push eventspring-cloud/spring-cloud-vault

Mark Paluch

commit sha f44a525dffac3a379807af40f1d6d412f918def5

Allow for configurable keystore / truststore type in ssl options We've introduced two new configuration properties (spring.cloud.vault.ssl.key-store-type=…/spring.cloud.vault.ssl.trust-store-type=…) to configure the keystore type including PEM support. Resolves gh-387.

view details

push time in a day

issue closedspring-cloud/spring-cloud-vault

Allow for configurable keystore / truststore type in ssl options

Background spring.cloud.vault.ssl config properties set allows for configuration of the keystore / truststore locations and password, but the type of these stores (jks vs pkcs12) is auto pulled from Keystore.getDefaultType().

I appreciate that jks as keystore type is being generally being deprecated in Java, but without delving deep into stack traces and debugging the error message you currently get if you use a jks but your JRE default type is pkcs is somewhat misleading (Short read of DER length). Granted the stack trace shows PKCS12Keystore.engineLoad but it's taken me a while to spot that.

Describe the solution you'd like

Add keyStoreType and trustStoreType options to VaultProperties.Ssl, and update VaultConfigurationUtil.createSslConfiguration to explicitly set the created keystore / truststore configurations accordingly.

closed time in a day

chriswhite199

issue closedspring-cloud/spring-cloud-vault

Cubbyhole authentication causes RefreshScope refresh to fail

Using org.springframework.cloud:spring-cloud-starter-vault-config:2.2.2.RELEASE with cubbyhole authentication mode, a RefreshScope refresh triggers Vault re-authentication, causing the refresh to fail with:

LeaseEventPublisher$LoggingErrorListener : [RequestedSecret [path='secret/vault-cubbyhole-refresh-issue', mode=ROTATE]] Lease [leaseId='null', leaseDuration=PT0S, renewable=false] Cannot login using Cubbyhole: wrapping token is not valid or does not exist; nested exception is org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request: [{"errors":["wrapping token is not valid or does not exist"]} ]

Please advise if there is a way to disable the re-authentication on refresh behavior.

Steps to reproduce are included in the README for the sample project below.

Sample https://github.com/hansenc/vault-cubbyhole-refresh-issue

closed time in a day

hansenc

issue commentspring-cloud/spring-cloud-vault

Cubbyhole authentication causes RefreshScope refresh to fail

Support for ConfigData API is now in place. When importing configuration (spring.config.import=vault://), the bootstrap context is no longer involved hence RefreshScope should not cause any interference.

Closing as the issue is basically superseded by #483.

hansenc

comment created time in a day

issue commentspring-cloud/spring-cloud-vault

Forbidden error accessing "/secret/application/<<profile>>"

I wasn't able to reproduce the issue. The mechanism that computes the paths hasn't changed. Feel free to provide a minimal sample that is able to demonstrate the problem.

Pedro-Fernandes

comment created time in a day

issue closedspring-cloud/spring-cloud-vault

Support for bound service account tokens in Kubernetes Auth method

Is your feature request related to a problem? Please describe.

Kubernetes 1.12 introduced Service Account Token Volume Projection into Pods as Beta capability. This allows for periodic rotation of the JWT Token of a Service account which is a security requirement in many organizations.

This feature request is to ensure that Spring Cloud Vault can properly Authenticate to Vault when using the Kubernetes Auth method.

HashiCorp Vault added support for this by having issuer and iss validation as part of the Kubernetes Auth Method configuration

Describe the solution you'd like Spring Cloud Vault should read the JWT token prior to Kubernetes Authentication, or reload the JWT token periodically. The above documentation says:

The application is responsible for reloading the token when it rotates. Periodic reloading (e.g. once every 5 minutes) is sufficient for most use cases.

Describe alternatives you've considered The application could use REST APIs instead of Spring Cloud Vault to login via Kubernetes Auth. This is problematic because it introduces additional complexity for developers to implement authentication and renewal logic.

Additional context Service Account Token Volume Projection is an important security capability introduced in Kubernetes 1.12. Prior to Service Account Token Volume Projection, Service Account tokens were static. This was a major issue as most organizations have a requirement to rotate credentials. Additional orchestration was needed to delete a Service Account secret and allow Kubernetes to create a new one.

The Service Account Token Volume Projection solves for this challenge elegantly as described above:

The kubelet will request and store the token on behalf of the pod, make the token available to the pod at a configurable file path, and refresh the token as it approaches expiration. Kubelet proactively rotates the token if it is older than 80% of its total TTL, or if the token is older than 24 hours.

closed time in a day

kawsark

issue commentspring-cloud/spring-cloud-vault

Support for bound service account tokens in Kubernetes Auth method

That limitation is now addressed by spring-projects/spring-vault#586.

kawsark

comment created time in a day

push eventspring-projects/spring-vault

Mark Paluch

commit sha 672fb86260bd26a863913d820cfcac64552d35b4

Extend AuthenticationStepsOperator for non-blocking resource access AuthenticationStepsOperator now uses DataBufferUtils to load credentials from a Resource for Suppliers that are instance of ResourceCredentialSupplier. Generic suppliers are called on the boundedElastic Scheduler to offload potentially blocking calls to a different thread. Resolves gh-586.

view details

Mark Paluch

commit sha e00a27120de411cd97f53ec6511a374940225251

Remove resource caching from PCF and Kubernetes authentication methods Since AuthenticationStepsOperator is now able to use non-blocking I/O for resource access, there's no need to cache the instance keys/tokens. See gh-586.

view details

Mark Paluch

commit sha 72746754833d78eecc4b6c7f88dc2858537d6b3c

Polishing Reorder methods according to their call sequence. See gh-586.

view details

push time in a day

issue closedspring-projects/spring-vault

Extend AuthenticationStepsOperator for non-blocking resource access

Some authentication mechanisms (Kubernetes, PCF) require file resources to read and post these as part of the login process. Right now, these mechanisms use a cached variant of the resource to avoid blocking File I/O which is unfortunate if the resources rotate. We have already AuthenticationSteps.fromSupplier(…) that accepts a supplier. If the supplier is an instance of CredentialSupplier, we should use DataBufferUtils to read the resource (assuming it's a file resource).

All other resource types could be read by using a scheduler.

See also:

  • spring-cloud/spring-cloud-config#1693
  • spring-cloud/spring-cloud-vault#491

closed time in a day

mp911de

issue openedspring-projects/spring-vault

Extend AuthenticationStepsOperator for non-blocking resource access

Some authentication mechanisms (Kubernetes, PCF) require file resources to read and post these as part of the login process. Right now, these mechanisms use a cached variant of the resource to avoid blocking File I/O which is unfortunate if the resources rotate. We have already AuthenticationSteps.fromSupplier(…) that accepts a supplier. If the supplier is an instance of CredentialSupplier, we should use DataBufferUtils to read the resource (assuming it's a file resource).

All other resource types could be read by using a scheduler.

See also:

  • spring-cloud/spring-cloud-config#1693
  • spring-cloud/spring-cloud-vault#491

created time in a day

issue commentr2dbc/r2dbc-spi

Allow query syntax customization in TCK TestKit

Yes. JDBC's ResultSet.get…(String) is case-insensitive, too and we stick to the same convention. Another thing to consider is that if a result contains the same column (label) name twice, the first one is used when calling Row.get(String). The metadata helps to resolve ambiguity because one can inspect columns and call Row.get(int).

elefeint

comment created time in 2 days

issue commentr2dbc/r2dbc-spi

Allow query syntax customization in TCK TestKit

Thanks for having a look. I'm going to prepare the merge.

I'm not sure about 2., whether we're on the same side. The verification about duplicate column names should verify that the resulting collection of column names Collection<String> columnNames = rowMetadata.getColumnNames() is case-insensitive (although the database itself may be case-sensitive, but that's a different topic).

elefeint

comment created time in 2 days

issue commentspring-projects/spring-vault

Support for KV Patch in VaultTemplate

Good proposal. Do you want to submit a pull request?

yfaney

comment created time in 2 days

issue commentlettuce-io/lettuce-core

lettuce doesnt queue commands to buffer in a failover scenario

Commands are queued during a disconnect but that doesn't pause the timeout scheduler. From a caller side, you don't want that the duration for a command is depending on the fact whether the connection is connected or disconnected. Instead, you want a reliable timeout cap so you can reason about service levels and a maximal latency.

If the server comes back during the configured timeout of one minute, the command will be re-sent. If the server is disconnected for longer than 1 minute, your application will see timeouts.

ALSowjanya

comment created time in 2 days

issue commentspring-cloud/spring-cloud-vault

Support for bound service account tokens in Kubernetes Auth method

Non-reactive basically means each application that does not use WebFlux or RSocket.

Using the reactive stack imposes limitations in terms of avoiding blocking calls. Reading a file uses blocking I/O. In Spring Vault, we don't support non-blocking File I/O yet.

By enabling the reactive Vault support, the selected authentication mechanism returns a descriptor (AuthenticationSteps) of activities that are required to log into Vault. These are typically HTTP calls and how to transform the outcome of HTTP calls to form a login request.

Since we have the limitation of avoiding blocking calls when running the application, what happens is that the Kubernetes token is read once and is reused for subsequent login calls, see KubernetesAuthentication.createAuthenticationSteps(…).

AuthenticationSteps is reused until application shutdown. It captures the JWT.

kawsark

comment created time in 2 days

push eventspring-guides/gs-accessing-data-r2dbc

Brutus5000

commit sha a0c05495391d4e0242836ea76127816726cd9f3b

Update to Gradle 6.5.1

view details

Brutus5000

commit sha 14db856a80c7726f003177e10296bc7781173ec9

Update to Spring Boot 2.3.1

view details

Mark Paluch

commit sha e050c91b0c0d71b703dce942501e1e7c2eb2a937

Update guide to use R2DBC support in Spring Boot 2.3 Closes gh-1. Closes gh-2.

view details

push time in 2 days

issue closedspring-guides/gs-accessing-data-r2dbc

Update guide to use R2DBC support in Spring Boot 2.3

As suggested by @langley-agm, it would be good to update this guide to use the R2DBC support in Spring Boot 2.3 rather than the experimental project.

closed time in 2 days

wilkinsona

PR closed spring-guides/gs-accessing-data-r2dbc

Update to Spring Boot 2.3

Closes #1

This pull request is not working as there seems to be a backwards incompatible change with the handling of schema.sql files. I made this as I thought I was doing something wrong when following the guide. But digging deeper now, from my understanding schema.sql is only supported by Spring JDBC, but there is no point in adding jdbc dependencies for the sake of generating a schema. However flyway suffers from the same issue, so I'm not sure how to proceed here (I'm open for suggestions).

We could create the schema manually. But that is not what people want. Also the hint that schema.sql and flyway are not supported this way belong in this guide as well.

+90 -60

7 comments

10 changed files

Brutus5000

pr closed time in 2 days

pull request commentspring-guides/gs-accessing-data-r2dbc

Update to Spring Boot 2.3

Closing in favor of c4d77ec.

Brutus5000

comment created time in 2 days

push eventspring-projects/spring-data-jpa

Mark Paluch

commit sha cfd8ef9cde4005729b57bbafc200052ffe62b0fa

DATAJPA-1783 - Migrate off ExpectedException and Test(expected=…) to AssertJ's assertThatExceptionOfType(…) and assertThat…Exception(…). We now no longer use the ExpectedException rule and JUnit's built-in exception assertion on Test-method level. Instead we use AssertJ's functional exception assertions.

view details

Mark Paluch

commit sha d4597d1c2da7c5902563646a3311bbf9b8f6a6e9

DATAJPA-1783 - Migrate tests to JUnit 5.

view details

Mark Paluch

commit sha 295664950d5f912450af5101a16a81c4fbf6e0ab

DATAJPA-1783 - Reduce test class and test method visibility where possible.

view details

push time in 2 days

issue commentspring-cloud/spring-cloud-vault

Support for bound service account tokens in Kubernetes Auth method

If I understand correctly, the only thing to do is to re-read the token file when the session token expires to re-login into Vault?

If so, then this is already the case for all non-reactive arrangements.

kawsark

comment created time in 2 days

PR closed spring-projects/spring-data-jpa

DATAJPA-1198 - Consistently avoid toLower(…) translation in Querydsl case-insensitive ORDER BY translation for non-String properties

Add condition to add lower in order by only String type

<!--

Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request. Make sure that:

-->

  • [x] You have read the Spring Data contribution guidelines.
  • [x] There is a ticket in the bug tracker for the project in our JIRA.
  • [x] You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • [x] You submit test cases (unit or integration tests) that back your changes.
  • [x] You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).
+19 -2

1 comment

2 changed files

marcusvoltolim

pr closed time in 2 days

pull request commentspring-projects/spring-data-jpa

DATAJPA-1198 - Consistently avoid toLower(…) translation in Querydsl case-insensitive ORDER BY translation for non-String properties

Thank you for your contribution. That's merged, polished, and backported now.

marcusvoltolim

comment created time in 2 days

push eventspring-projects/spring-data-jpa

Marcus Vinícius Neves Voltolim Satelis

commit sha 34437119667cc9ac85129775514265f53729232b

DATAJPA-1198 - Consistently avoid toLower(…) translation in Querydsl case-insensitive ORDER BY translation for non-String properties. Original pull request: #428.

view details

Mark Paluch

commit sha 1281c7c44d955e2312c113c517ee06208221363c

DATAJPA-1198 - Polishing. Compare types using equals(…). Reformat code. Original pull request: #428.

view details

push time in 2 days

push eventspring-projects/spring-data-jpa

Marcus Vinícius Neves Voltolim Satelis

commit sha f5ba26eedffb6f87a3416732fae110d656aa20bc

DATAJPA-1198 - Consistently avoid toLower(…) translation in Querydsl case-insensitive ORDER BY translation for non-String properties. Original pull request: #428.

view details

Mark Paluch

commit sha 48597dca246178c0d7e6952425004849d3fb02c0

DATAJPA-1198 - Polishing. Compare types using equals(…). Reformat code. Original pull request: #428.

view details

push time in 2 days

push eventspring-projects/spring-data-geode

Mark Paluch

commit sha d73df642c80d9479b240d33c23f675cf8455abcd

DATAGEODE-374 - Adopt to changes in Spring Data Commons. Update mocks for changed behavior.

view details

push time in 2 days

issue commentspring-projects/spring-data-r2dbc

Enum values used through @Query not converted to String

Sure, feel free to submit a pull request.

Tienisto

comment created time in 3 days

push eventspring-projects/spring-data-jdbc

Mark Paluch

commit sha 109adbcbf4eb1cfa578d3313eec99de4c2737c29

DATAJDBC-606 - Adopt to changes in Spring Data Commons. Adopt to new mock requirements.

view details

push time in 3 days

push eventspring-projects/spring-data-jpa

Mark Paluch

commit sha d4ea22179529ecbbd54d15991f73b728a162201f

DATAJPA-1782 - Adopt to changes in Spring Data Commons. Update mocks to new behavior.

view details

push time in 3 days

push eventspring-projects/spring-data-keyvalue

Mark Paluch

commit sha bfd5f0152cfceb1b1be3784f94370f7be53da210

DATAKV-321 - Adopt to changes in Spring Data Commons. Update mocks with new behavior.

view details

push time in 3 days

push eventspring-projects/spring-data-commons

Mark Paluch

commit sha eadbe80f039442daba9c1015766b61b3612d8285

DATACMNS-1802 - Extract Flux.from(…) into own method. For some reason, calling Flux.from(…) in its own, static method, heals NoClassDefFoundError even though the method is not used during runtime nor Publisher is defined in a method signature.

view details

push time in 3 days

push eventspring-projects/spring-data-commons

Mark Paluch

commit sha b3d0fea061bef3b0c2202aa321ca8ffc8505a215

DATACMNS-1637 - Add default stream() method to CloseableIterator. CloseableIterator now allows construction of a Stream that is associated with a close hook to release resources after its use. CloseableIterator<Person> iterator = …; try (Stream<Person> stream = iterator.stream()) { assertThat(stream.count()).isEqualTo(3); }

view details

push time in 3 days

push eventspring-projects/spring-data-commons

Mark Paluch

commit sha 3ae8afa0280a41de37839c5bf690aa5e553547bc

DATACMNS-1637 - Add default stream() method to CloseableIterator. CloseableIterator now allows construction of a Stream that is associated with a close hook to release resources after its use. CloseableIterator<Person> iterator = …; try (Stream<Person> stream = iterator.stream()) { assertThat(stream.count()).isEqualTo(3); }

view details

push time in 3 days

issue closedspring-projects/spring-data-r2dbc

R2DBC client logging $1 instead of real values on parametrized queries

We use spring-boot-starter-data-r2dbc version 2.3.1-RELEASE.

When we use such code as this: query(where("instance_id").is(instanceId)) on log we see this: [SELECT parts.* FROM parts WHERE parts.instance_id = $1]

How can we see real value of instanceId on log instead of $1?

closed time in 3 days

Slava96

issue commentspring-projects/spring-data-r2dbc

Allow suspend + List in CoroutineCrudRepository

That's in place now.

Tienisto

comment created time in 3 days

issue closedspring-projects/spring-data-r2dbc

Allow suspend + List in CoroutineCrudRepository

Hello,

usually when I want a list, I use a function returning a Flow followed by toList() which is working perfectly. Here is what I write now:

interface UserRepo : CoroutineCrudRepository<User, Long> {
    suspend fun findByEmail(email: String): User?
    fun findByFirstName(firstName: String): Flow<User>
}

// in use:
val users = userRepo.findByFirstName("Max").toList() // toList() is the build-in suspended function

What about including this into the repository itself? Then the code is much cleaner and because toList() is a suspended function, the thread is not blocked anyways.

interface UserRepo : CoroutineCrudRepository<User, Long> {
    suspend fun findByEmail(email: String): User?
    suspend fun findByFirstName(firstName: String): List<User>
}

Currently an exception is thrown when I try the 2nd example.

closed time in 3 days

Tienisto

push eventspring-projects/spring-data-mongodb

Mark Paluch

commit sha 91c39e2825076d7bc2394f62830caa84b065a41e

DATAMONGO-2630 - Add support for suspend repository query methods returning List<T>.

view details

push time in 3 days

push eventspring-projects/spring-data-cassandra

Mark Paluch

commit sha a4a67b6e6329f2df9e255a346a394962bc65bd04

DATACASS-806 - Add support for suspend repository query methods returning List<T>.

view details

push time in 3 days

push eventspring-projects/spring-data-r2dbc

Mark Paluch

commit sha 7a094b6765acd3ee63e46ee5d7ce899de579785a

#395 - Add support for suspend repository query methods returning List<T>.

view details

push time in 3 days

push eventspring-projects/spring-data-commons

Mark Paluch

commit sha 82cb36f72735b3b668d6a820fd54280d2695c3ce

DATACMNS-1802 - Add support for suspend repository query methods returning List<T>. We now support returning List<T> from a suspended repository query method to simplify consumption of collection queries.

view details

push time in 3 days

issue commentspring-projects/spring-data-r2dbc

Allow suspend + List in CoroutineCrudRepository

Depends also on a change in Spring Data Commons (DATACMNS-1802).

Tienisto

comment created time in 3 days

delete branch spring-projects/spring-data-commons

delete branch : issue/DATACMNS-1736

delete time in 3 days

PR closed spring-projects/spring-data-commons

DATACMNS-1736 - Use BeanFactory lookup in configuration classes instead of intercepted local bean methods

We now use @Configuration(proxyBeanMethods = false) and use BeanFactory bean lookups to avoid CGlib proxy creation.

Using Spring's BeanProvider.getIfUnique(…) instead of catching NoSuchBeanDefinitionException.


Related ticket: DATACMNS-1736

+116 -64

4 comments

6 changed files

mp911de

pr closed time in 3 days

issue commentmp911de/logstash-gelf

Fieldtype discovery wrong for strings starting with zero

Value type discovery was implemented on a best-effort basis without reimplementing a full parser. Type discovery allows for hex values and scientific notation inputs but may lead to wrong discovery results. Do you want to submit a pull request to address that issue?

elektro-wolle

comment created time in 3 days

push eventspring-projects/spring-data-jdbc

Mark Paluch

commit sha 9cd8fc16b35cf7bef2deea38d190213f6fcaceb0

DATAJDBC-508 - Add support for @Value in persistence constructors. We now evaluate @Value annotations in persistence constructors to compute values when creating object instances. AtValue can be used to materialize values for e.g. transient properties. Root properties map to the ResultSet from which an object gets materialized. class WithAtValue { private final @Id Long id; private final @Transient String computed; public WithAtValue(Long id, @Value("#root.first_name") String computed) { // obtain value from first_name column this.id = id; this.computed = computed; } }

view details

push time in 3 days

issue commentspring-projects/spring-data-r2dbc

Add support for batch insert

Depending on the database type, you need to tell the database to return generated keys (see the Postgres documentation on RETURNING). Then, extract the generated keys by consuming Result.map((row, metadata) -> row.get("name_of_id_column", Long.class)).

deblockt

comment created time in 3 days

PR closed spring-projects/spring-data-jdbc

DATAJDBC-588 add test for field with @Transient annotation

Just made a failing test case DATAJDBC-588.

Maybe i don't get the reason, but with the available documentation I think this should work

+14 -0

3 comments

1 changed file

benzen

pr closed time in 3 days

pull request commentspring-projects/spring-data-jdbc

DATAJDBC-588 add test for field with @Transient annotation

We don't plan to merge this pull request as it introduces a failing test for a feature that isn't supported.

benzen

comment created time in 3 days

push eventspring-projects/spring-data-jdbc

Mark Paluch

commit sha 185b543109181200e465eaeb9012fbf10cd9d795

DATAJDBC-596 - Fix less-than comparator from ligature to less-than symbol.

view details

push time in 3 days

push eventspring-projects/spring-data-jdbc

Mark Paluch

commit sha 38139d7d83af654ea5700941766759d73fa8d4e2

DATAJDBC-596 - Fix less-than comparator from ligature to less-than symbol.

view details

Mark Paluch

commit sha 842a309f27fd80d2c1fd76399482f84a5130f0d1

DATAJDBC-604 - Support empty IN lists. We now support empty IN lists by rendering a condition that evaluates to FALSE using 1 = 0. For NOT IN, we render a condition that evaluates to TRUE using 1 = 1.

view details

push time in 3 days

issue closedspring-projects/spring-data-r2dbc

Allow in-clause to be empty in repository methods

Hello,

My server has thrown an error when the parameter was an empty list. It works in Spring Data JPA so it would be nice if Spring Data R2DBC also handles this edge case.

org.springframework.r2dbc.BadSqlGrammarException: executeMany; bad SQL grammar [SELECT my_table.id, my_table.name FROM my_table WHERE my_table.name IN ()]; nested exception is io.r2dbc.postgresql.ExceptionFactory$PostgresqlBadGrammarException: [42601] Syntaxfehler bei »)«

Here is an example:

// repository
interface MyRepository extends ReactiveCrudRepository<MyEntity, Integer>  {
    Flux<MyEntity> findByNameIn(List<String> names);
}

// controller methods
@GetMapping("/non-empty")
public Flux<MyEntity> getNonEmpty() {
    return repository.findByNameIn(List.of("max", "tom", "anna"));
}

@GetMapping("/empty")
public Flux<MyEntity> getEmpty() {
   return repository.findByNameIn(List.of()); // error
}
-- table
CREATE TABLE my_table (
    id SERIAL PRIMARY KEY,
    name TEXT NOT NULL
);

Version: 1.2.0-RC1 Database: PostgreSQL

closed time in 3 days

Tienisto

issue commentspring-projects/spring-data-r2dbc

Allow in-clause to be empty in repository methods

The change needs to be done in Spring Data Relational, see https://jira.spring.io/browse/DATAJDBC-604 for further reference.

Tienisto

comment created time in 3 days

issue commentlettuce-io/lettuce-core

java.util.NoSuchElementException: Pool exhausted When starting app

#1363 introduced two new methods BoundedAsyncPool.create(…) and AsyncConnectionPoolSupport.createBoundedObjectPoolAsync(…) that return CompletionStage<Pool>. We didn't want to introduce blocking behavior so adding new methods was the only option to allow for synchronization.

hepin1989

comment created time in 3 days

issue commentspring-projects/spring-data-r2dbc

Allow in-clause to be empty in repository methods

Thanks a lot. It makes sense to render a condition that always evaluates to false.

Tienisto

comment created time in 4 days

PullRequestReviewEvent

issue commentspring-projects/spring-data-r2dbc

Decode enums in @Query

Thanks a lot! We apply input-value to R2DBC driver-compliant value conversion for derived queries. For String-based queries, we don't apply that type of value conversion. We should fix that.

Tienisto

comment created time in 4 days

issue closedspring-projects/spring-data-r2dbc

Result of derived ExistsBy Query not handled properly

CREATE TABLE users
(
    id   bigserial primary key,
    user_name text unique
);
@Table("users")
data class User(
    @Id
    val id: Long? = null,
    val userName: String
)

interface UserRepository : CoroutineCrudRepository<User, Long> {

    suspend fun existsByUserName(userName: String): Boolean

    @Query("select exists (select 1 from users where user_name = :userName)")
    suspend fun customExistsByUserName(userName: String): Boolean
}

while customExistsByUserName works, existsByUserName will lead to an exception:

Failed to convert from type [io.r2dbc.postgresql.PostgresqlRow] to type [java.lang.Boolean] for value 'PostgresqlRow{context=ConnectionContext{client=io.r2dbc.postgresql.client.ReactorNettyClient@69980e91, codecs=io.r2dbc.postgresql.codec.DefaultCodecs@62633db7, connection=PostgresqlConnection{client=io.r2dbc.postgresql.client.ReactorNettyClient@69980e91, codecs=io.r2dbc.postgresql.codec.DefaultCodecs@62633db7}, configuration=PostgresqlConnectionConfiguration{applicationName='r2dbc-postgresql', autodetectExtensions='true', connectTimeout=null, database='test', extensions=[], fetchSize=io.r2dbc.postgresql.PostgresqlConnectionConfiguration$Builder$$Lambda$808/0x0000000800664c40@7b13030d, forceBinary='false', host='localhost', loopResources='null', options='{}', password='********', port=32797, preferAttachedBuffers=false, socket=null, tcpKeepAlive=false, tcpNoDelay=false, username='postgres'}, portalNameSupplier=io.r2dbc.postgresql.DefaultPortalNameSupplier@1be9d0e7, statementCache=IndefiniteStatementCache{cache={INSERT INTO users (user_name) VALUES ($1) RETURNING *={[I@7d8d6c1a=MonoCacheTime}, SELECT users.id FROM users WHERE users.user_name = $1 LIMIT 1={[I@544819bc=MonoCacheTime}}, client=io.r2dbc.postgresql.client.ReactorNettyClient@69980e91, counter=2}}, columns=[Field{column=1, dataType=20, dataTypeModifier=-1, dataTypeSize=8, format=FORMAT_TEXT, name='id', table=16428}], isReleased=false}'; nested exception is java.lang.IllegalArgumentException: Cannot decode value of type java.lang.Boolean
org.springframework.core.convert.ConversionFailedException: Failed to convert from type [io.r2dbc.postgresql.PostgresqlRow] to type [java.lang.Boolean] for value 'PostgresqlRow{context=ConnectionContext{client=io.r2dbc.postgresql.client.ReactorNettyClient@69980e91, codecs=io.r2dbc.postgresql.codec.DefaultCodecs@62633db7, connection=PostgresqlConnection{client=io.r2dbc.postgresql.client.ReactorNettyClient@69980e91, codecs=io.r2dbc.postgresql.codec.DefaultCodecs@62633db7}, configuration=PostgresqlConnectionConfiguration{applicationName='r2dbc-postgresql', autodetectExtensions='true', connectTimeout=null, database='test', extensions=[], fetchSize=io.r2dbc.postgresql.PostgresqlConnectionConfiguration$Builder$$Lambda$808/0x0000000800664c40@7b13030d, forceBinary='false', host='localhost', loopResources='null', options='{}', password='********', port=32797, preferAttachedBuffers=false, socket=null, tcpKeepAlive=false, tcpNoDelay=false, username='postgres'}, portalNameSupplier=io.r2dbc.postgresql.DefaultPortalNameSupplier@1be9d0e7, statementCache=IndefiniteStatementCache{cache={INSERT INTO users (user_name) VALUES ($1) RETURNING *={[I@7d8d6c1a=MonoCacheTime}, SELECT users.id FROM users WHERE users.user_name = $1 LIMIT 1={[I@544819bc=MonoCacheTime}}, client=io.r2dbc.postgresql.client.ReactorNettyClient@69980e91, counter=2}}, columns=[Field{column=1, dataType=20, dataTypeModifier=-1, dataTypeSize=8, format=FORMAT_TEXT, name='id', table=16428}], isReleased=false}'; nested exception is java.lang.IllegalArgumentException: Cannot decode value of type java.lang.Boolean
	at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:47)
	at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:191)
	at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:174)
	at org.springframework.data.r2dbc.convert.MappingR2dbcConverter.read(MappingR2dbcConverter.java:113)
	at org.springframework.data.r2dbc.convert.EntityRowMapper.apply(EntityRowMapper.java:46)
	at org.springframework.data.r2dbc.convert.EntityRowMapper.apply(EntityRowMapper.java:29)
	at io.r2dbc.postgresql.PostgresqlResult.lambda$map$1(PostgresqlResult.java:113)
	at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:96)
	at reactor.core.publisher.FluxTakeUntil$TakeUntilPredicateSubscriber.onNext(FluxTakeUntil.java:77)
	at reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onNext(FluxFilterFuseable.java:112)
	at reactor.core.publisher.FluxContextStart$ContextStartSubscriber.onNext(FluxContextStart.java:96)
	at io.r2dbc.postgresql.util.FluxDiscardOnCancel$FluxDiscardOnCancelSubscriber.onNext(FluxDiscardOnCancel.java:86)
	at reactor.core.publisher.FluxCreate$BufferAsyncSink.drain(FluxCreate.java:793)
	at reactor.core.publisher.FluxCreate$BufferAsyncSink.next(FluxCreate.java:718)
	at reactor.core.publisher.FluxCreate$SerializedSink.next(FluxCreate.java:153)
	at io.r2dbc.postgresql.client.ReactorNettyClient$Conversation.emit(ReactorNettyClient.java:725)
	at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.emit(ReactorNettyClient.java:976)
	at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.onNext(ReactorNettyClient.java:850)
	at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.onNext(ReactorNettyClient.java:757)
	at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:112)
	at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:845)
	at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:213)
	at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:213)
	at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:256)
	at reactor.netty.channel.FluxReceive.onInboundNext(FluxReceive.java:362)
	at reactor.netty.channel.ChannelOperations.onInboundNext(ChannelOperations.java:358)
	at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:96)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:311)
	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:425)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalArgumentException: Cannot decode value of type java.lang.Boolean
	at io.r2dbc.postgresql.codec.DefaultCodecs.decode(DefaultCodecs.java:152)
	at io.r2dbc.postgresql.PostgresqlRow.decode(PostgresqlRow.java:90)
	at io.r2dbc.postgresql.PostgresqlRow.get(PostgresqlRow.java:67)
	at org.springframework.data.r2dbc.convert.R2dbcConverters$RowToBooleanConverter.convert(R2dbcConverters.java:103)
	at org.springframework.data.r2dbc.convert.R2dbcConverters$RowToBooleanConverter.convert(R2dbcConverters.java:97)
	at org.springframework.core.convert.support.GenericConversionService$ConverterAdapter.convert(GenericConversionService.java:385)
	at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:41)
	... 49 more

closed time in 4 days

pmaedel

issue commentspring-projects/spring-data-r2dbc

Result of derived ExistsBy Query not handled properly

That's fixed now.

pmaedel

comment created time in 4 days

push eventspring-projects/spring-data-r2dbc

Mark Paluch

commit sha d3823947aa42e41aff085157f76e6dc58de31ee8

#468 - Correctly map result of exists queries. We now map results of exists queries to a boolean flag to ensure proper decoding. Previously, results were attempted to be mapped onto a primitive type which failed as there's no converter registered for Row to Boolean.

view details

push time in 4 days

issue commentspring-projects/spring-data-r2dbc

Result of derived ExistsBy Query not handled properly

You're right, my bad. I changed the title to reflect the issue.

pmaedel

comment created time in 4 days

issue commentspring-projects/spring-data-r2dbc

ExistsBy Query derivation is broken

String-based queries via @Query do not support exists/count projections yet.

pmaedel

comment created time in 4 days

push eventspring-projects/spring-data-r2dbc

Mark Paluch

commit sha f0b30f0ca0a864dde2d1f29e2d87cd4adc2d6647

#467 - Migrate tests to JUnit 5. Migrate also ExternalDatabase from JUnit rule to BeforeAllCallback and RegisterExtension.

view details

push time in 4 days

issue closedspring-projects/spring-data-r2dbc

Ask questions

I have some questions to ask

  1. If I want to join multiple tables, can I use jpql only, and does DatabaseClient support it
  2. Will r2dbc support jpaspecification executor in the future
  3. How long do you think r2dbc will take, like JPA

closed time in 4 days

ChenZheOnePiece

issue commentspring-projects/spring-data-r2dbc

Ask questions

R2DBC isn't JDBC and therefore it's not compatible with JPA.

  1. If I want to join multiple tables, can I use jpql only, and does DatabaseClient support it

You can provide your own SQL query that contains JOIN clauses.

  1. Will r2dbc support jpaspecification executor in the future

It does not and it won't ever support JPA Specifications

  1. How long do you think r2dbc will take, like JPA

JPA follows a different concept than Spring Data R2DBC/JDBC do. I think Spring Data R2DBC won't ever reach the same level of features that JPA provides because they are conceptually entirely different.

ChenZheOnePiece

comment created time in 4 days

issue commentspring-projects/spring-data-r2dbc

Decode enums in @Query

Can you provide also a stack trace?

Tienisto

comment created time in 4 days

issue commentspring-projects/spring-data-r2dbc

Allow in-clause to be empty in repository methods

How is an empty IN supposed to behave? What SQL should be issued to the database?

Tienisto

comment created time in 4 days

issue openedspring-projects/spring-data-r2dbc

Migrate tests to JUnit 5

created time in 4 days

Pull request review commentlettuce-io/lettuce-core

implement command handlers

+package io.lettuce.core.models.events;++import java.time.Duration;+import java.time.Instant;++/**+ * @author sokomishalov+ */+public class CommandSucceededEvent<K, V, T> extends CommandBaseEvent<K, V, T> {++    private final Instant startedAt;+    private final Instant succeededAt;++    public CommandSucceededEvent(CommandStartedEvent<K, V, T> startedEvent) {+        super(startedEvent.getCommand(), startedEvent.getContext());+        this.startedAt = startedEvent.getStartedAt();+        this.succeededAt = Instant.now();+    }++    public Duration getExecuteDuration() {+        return Duration.between(startedAt, succeededAt);+    }++    public Instant getStartedAt() {+        return startedAt;

Here's a good spot to create an instant from a timestamp.

SokoMishaLov

comment created time in 4 days

Pull request review commentlettuce-io/lettuce-core

implement command handlers

+package io.lettuce.core.protocol;++import io.lettuce.core.RedisCommandExecutionException;+import io.lettuce.core.RedisCommandListener;+import io.lettuce.core.models.events.CommandFailedEvent;+import io.lettuce.core.models.events.CommandStartedEvent;+import io.lettuce.core.models.events.CommandSucceededEvent;+import io.lettuce.core.output.CommandOutput;+import io.netty.buffer.ByteBuf;++/**+ * @author sokomishalov+ */+public class EventListenerCommand<K, V, T> implements RedisCommand<K, V, T>, DecoratedCommand<K, V, T> {++    private final CommandStartedEvent<K, V, T> startedEvent;+    private final RedisCommandListener listener;++    public EventListenerCommand(CommandStartedEvent<K, V, T> startedEvent, RedisCommandListener listener) {

Let's keep only a reference to the command and the context.

We should be able to make this class package-private.

SokoMishaLov

comment created time in 4 days

Pull request review commentlettuce-io/lettuce-core

implement command handlers

+package io.lettuce.core.models.events;++import java.time.Duration;+import java.time.Instant;++/**+ * @author sokomishalov+ */+public class CommandSucceededEvent<K, V, T> extends CommandBaseEvent<K, V, T> {++    private final Instant startedAt;

Let's keep timestamps as long to reduce allocations.

SokoMishaLov

comment created time in 4 days

more