Missing AvroSchemaMessageConverter class in spring-cloud-stream-schema - 1.2.0.RC1 - maven

I am missing AvroSchemaMessageConverter class in spring-cloud-stream-schema - 1.2.0.RC1. I want through this link Missing schema module for spring-cloud-stream.
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-schema</artifactId>
<version>1.2.0.RC1</version>
</dependency>
When I looked at the pom.xml, I was anticipating the class AvroSchemaMessageConverter.java will be available in spring-cloud-stream-1.2.0.RC1.jar. But it does not exist as per the picture below:
Can someone point to the dependency I am missing. My maven dependencies for spring-cloud-stream to post to Kafka topics.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Dalston.RC1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-kafka</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.11</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Apache avro serialization support -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-schema</artifactId>
</dependency>
</dependencies>

It's in the schema jar:
<!-- Apache avro serialization support -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-schema</artifactId>
</dependency>
Notice the full hierarchy of that GitHub Artifact...
spring-cloud-stream/spring-cloud-stream-schema/src/main/java/org/springframework/cloud/stream/schema/avro/AvroSchemaMessageConverter.java

The link you posted explicitly mentions that you need to include org.springframework.cloud:spring-cloud-stream-schema, where AvroSchemaMessageConverter lives. You will also need to add an Avro version explicitly.

Related

What are the required maven dependencies to upload files to oracle object storage from Spring Boot 3.0 and Java 17?

I am trying to upload files to oracle Object Storage using Spring Boot 3.0 and Java 17. I am getting the following exception
java.util.NoSuchElementException: No http provider available; add dependency on one of the oci-java-sdk-common-httpclient-* choices, e.g. oci-java-sdk-common-httpclient-jersey
The dependency I used:
<dependencies>
<dependency>
<groupId>com.oracle.oci.sd`your text`k</groupId>
<artifactId>oci-java-sdk-objectstorage</artifactId>
</dependency>
</dependencies>`
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-bom</artifactId>
<version>3.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
I was able to upload files to Object storage with Spring Boot 2.x.x and Java 11 with the above dependency.
Just add the dependency suggested in the exception's message:
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common-httpclient-jersey</artifactId>
<version>3.2.0</version>
</dependency>
to your pom.xml file
Thank you #devwebcl. oci-java-sdk-common-httpclient-jersey was required but it wasn't sufficient. I had to add following dependency additionally.
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-addons-resteasy-client-configurator</artifactId>
</dependency>
So if someone want to upload files to object storage from Spring Boot 3, include the three dependencies below.
<dependencies>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-addons-resteasy-client-configurator</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-objectstorage</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common-httpclient-jersey</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-bom</artifactId>
<version>3.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common-httpclient-jersey</artifactId>
<version>3.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
enter code here

Installing maven dependencies for JBPM casefile services

I am trying to install the dependencies for org.jbpm:jbpm-case-mgmt-api and org.jbpm:jbpm-services-api to access ServiceRegistry, Case Service, CaseFileInstance, etc. to access case data but I just can't seem to get my pom.xml correct. I am using version 7.48.0.Final-redhat-00004. Including
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-case-mgmt</artifactId>
<version>7.48.0.Final-redhat-00004</version>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-case-mgmt-api</artifactId>
<version>7.48.0.Final-redhat-00004</version>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-case-mgmt-impl</artifactId>
<version>7.48.0.Final-redhat-00004</version>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-user-bom-parent</artifactId>
<version>${version.org.kie}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-bom</artifactId>
<version>${version.org.kie}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-parent</artifactId>
<version>${version.org.kie}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-internal</artifactId>
<version>${version.org.kie}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-services-api</artifactId>
<version>${version.org.kie}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-case-mgmt-api</artifactId>
<version>${version.org.kie}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-case-mgmt-cmmn</artifactId>
<version>${version.org.kie}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
as dependencies still leave all my casefile API references as missing (and the above seems like it is specifying these libraries twice!) What dependencies do I need to add to my pom.xml?
The property version.org.kie is defined as 7.48.0.Final-redhat-00004.
It should be enough to include
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-document</artifactId>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-case-mgmt-api</artifactId>
</dependency>
with the corresponding version (if you don't use dependencyManagement section).
Try and paste the exception you obtain

issue with circuit breaker and AbstractCloudConfig when upgrading to spring boot 2.0.3

Currently we are upgrading our app to use spring boot 2.0.3.
The app is deployed to PCF and uses circuit breaker, also we use AbstractCloudConfig in our code in order to initialize a session and retrieve the properties for cassandra from the user provided service.
We noticed that when checking the health using actuator/health , rabbit fails and the cause is due to connection refused.
It's trying to connect to localhost instead of the host provided by the rabbit service in pcf.
After testing and debugging the app , we came to a conclusion that the issue is due to AbstractCloudConfig.
In order to verify this conclusion , we created a demo app that uses circuit breaker and also AbstractCloudConfig and we noticed the same issue, When we removed the use of AbstractCloudConfig everything was fine.
Is there a different way to use AbstractCloudConfig in spring boot 2.0.3 or this is an issue?
${spring.boot.version} = 2.0.3.RELEASE
Dependencies in pom.xml:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.pivotal.spring.cloud</groupId>
<artifactId>spring-cloud-services-dependencies</artifactId>
<version>2.0.1.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Finchley.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-releasetrain</artifactId>
<version>Kay-SR8</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-cassandra</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
<dependency>
<groupId>io.pivotal.spring.cloud</groupId>
<artifactId>spring-cloud-services-starter-circuit-breaker</artifactId>
</dependency>
<dependency>
<groupId>io.pivotal.spring.cloud</groupId>
<artifactId>spring-cloud-services-starter-service-registry</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>
CloudCassandraConnectionConfig class:
#Configuration
#Profile("cloud")
public class CloudCassandraConnectionConfig extends AbstractCloudConfig
{
}

use Zipkin+ElasticSearch+Sleuth+rabbitMQ can't find "services"

SpringCloud version:Dalston.SR1,
rabbitMQ version:3.6.10,ElasticSearch version:6.2.4
There was nothing unusual when I use MySQL as a storage.
Now I use ElasticSearch.I can't find any services.
I lost something?
here is the picture:
application.properties
server.port=11008
spring.application.name=microservice-zipkin-stream-server-es
spring.sleuth.enabled=false
spring.sleuth.sampler.percentage=1.0
zipkin.storage.StorageComponent = elasticsearch
zipkin.storage.type=elasticsearch
zipkin.storage.elasticsearch.cluster=elasticsearch-zipkin-cluster
zipkin.storage.elasticsearch.hosts=127.0.0.1:9300
zipkin.storage.elasticsearch.max-requests=64
zipkin.storage.elasticsearch.index=zipkin
zipkin.storage.elasticsearch.index-shards=5
zipkin.storage.elasticsearch.index-replicas=1
spring.rabbitmq.host=192.168.0.162
spring.rabbitmq.port=5672
spring.rabbitmq.username=basefrm
spring.rabbitmq.password=basefrm
eureka.instance.hostname=192.168.0.162
eureka.client.serviceUrl.defaultZone=http://192.168.0.162:8761/eureka/
management.security.enabled=false
pom.xml
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-ui</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin</artifactId>
<version>2.4.1</version>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-storage-elasticsearch-http</artifactId>
<version>2.4.1</version>
<optional>true</optional>
</dependency>
You're using an ancient version of Sleuth, can you please upgrade? Why do you provide Zipkin's version manually? Also as far as I see you're using the Sleuth's Zipkin server (that is deprecated in Edgware and removed in Finchley). My suggestion is that you stop using the Sleuth's Stream server (you can read more about this here https://cloud.spring.io/spring-cloud-static/Edgware.SR3/single/spring-cloud.html#_sleuth_with_zipkin_via_rabbitmq_or_kafka).
<dependencyManagement> (1)
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${release.train.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependency> (2)
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>
<dependency> (3)
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId>
</dependency>
1) In order not to pick versions by yourself it’s much better if you add the dependency management via the Spring BOM
2) Add the dependency to spring-cloud-starter-zipkin - that way all dependent dependencies will be downloaded
3) To automatically configure rabbit, simply add the spring-rabbit dependency

Spring BOM, commons-logging, Log4j2 and Maven dependency management

I'm building a parent POM for several modules. They are using Spring and Log4j2, so I want to define relevant configuration in section of parent POM and make use of new Spring BOM feature to avoid a mess with versions of Spring components.
According to documentation, this is the correct use of Spring BOM:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>4.2.0.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
.......
</dependencyManagement>
Now, I need to exclude dependency on commons-logging from spring-core. This is the right way to do it, according to Spring docs:
<dependencyManagement>
.......
<!-- Remove JCL from Spring deps -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.2.0.RELEASE</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Add Log4j2 with JCL bridge -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
<version>${log4j2.version}</version>
</dependency>
.......
</dependencyManagement>
Removing version number from the definition of spring-core dependency causes missing spring-core version error during compilation phase ('dependencies.dependency.version' for org.springframework:spring-core:jar is missing). Effectively, it requires me to re-specify Spring version number - something that Spring BOM was supposed to solve.
Do you know any way to make this work based on BOM version only?
Why don't you put the exclusion directly into the bom declaration:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${spring.version}</version>
<type>pom</type>
<scope>import</scope>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
Or you could add commons-logging to dependencyManagement as well, if you want to directly control its version. This is what I did in a recent project:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${spring.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons-logging.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
The log4j jcl bridge does not replace the commons-logging jar. Leave it in. It just creates a binding between commons logging and log4j2.

Resources