Giter VIP home page Giter VIP logo

code-examples's People

Contributors

ajibade3210 avatar arkuksin avatar arpendu11 avatar bakic avatar cbenaveen avatar irtaza2009 avatar jarjanazy avatar jgoerner avatar maiklins avatar mufa0 avatar murtuza-ranapur avatar ortelagode avatar petromir avatar petros0 avatar prabhakar349 avatar pralhad-cmd avatar pratikdas avatar ranjani2412 avatar ranjanih avatar robyed avatar saajn avatar sagaofsilence avatar sailfishdev avatar silenum avatar snicoll avatar susetech avatar syedaf avatar thombergs avatar tolik518 avatar yavuztas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

code-examples's Issues

React Consumer side PACT are not working/creating

While running the consumer graphql contract test command: yarn test:pact:graphql

Sharing path for reference :
https://github.com/thombergs/code-examples/tree/master/pact/pact-react-consumer

It is giving the following error:

Error: Network error: request to http://localhost:8080/graphql failed, reason: connect ECONNREFUSED 127.0.0.1:8080
    at new ApolloError (/code-examples/pact/pact-react-consumer/node_modules/src/errors/ApolloError.ts:56:5)
    at /code-examples/pact/pact-react-consumer/node_modules/src/core/QueryManager.ts:509:31
    at /code-examples/pact/pact-react-consumer/node_modules/src/core/QueryManager.ts:1041:11
    at Array.forEach (<anonymous>)
    at /code-examples/pact/pact-react-consumer/node_modules/src/core/QueryManager.ts:1040:10
    at Map.forEach (<anonymous>)

HATEOAS always return id with null

Hi:
First, thanks for read my message.
I found a page that use feign & spring hateoas to get resource from spring data rest. But I found that I could not get id for saving and updating. Could you help me?
There's spring data rest returning.

{
"id": 16,
"firstName": "MMMMMM",
"lastName": "CCCCCCC",
"age": 119,
"_links": {
  "self": {
    "href": "http://localhost:8080/customers/16"
  },
  "customer": {
    "href": "http://localhost:8080/customers/16"
  }
}

Client receive the following

{
  "id": null,
  "firstName": "MMMMMM",
  "lastName": "CCCCCCC",
  "age": 119,
  "_links": {
    "self": {
      "href": "http://localhost:8080/customers/16"
    },
    "customer": {
      "href": "http://localhost:8080/customers/16"
    }
  }

Launch Darkley flags creations instructions not given

from the code (https://github.com/thombergs/code-examples/tree/master/spring-boot/feature-flags) I read

LD Flags that are to be created manually after login into launchdarkly as read from the code

1. Boolean Type with variations

global-boolean-flag : true or false
user-based-percentage-rollout : true or false
user-clicked-flag : true or false

2. Date as String with variations

current-date-for-welcome-message : "now", "11-01-2023"
current-date-for-welcome-email : "now", "12-02-2024"

to be created.. however exact ways to create these flags with all the variations values is not clear, kindly put them in readme.md

Try-with-Resources was not added with Java_9

In the article it says T-W-R was added with Java_9. Thats wrong, it was added with Java_7.
So this file https://github.com/thombergs/code-examples/blob/1f37a81b90003c35beed6216432f689936917cb1/core-java/versions/src/main/java/com/reflectoring/io/java9/TryWithResources.java should be deleted (or al least be moved to s.th. like 'other stuff').

Java_7 release-notes:
https://www.oracle.com/java/technologies/javase/jdk7-relnotes.html
Info/ read:
https://www.baeldung.com/java-try-with-resources

Critical information missing in your Properties example

I have looked with great interest at your @ConfigurationProperties article and code:

https://reflectoring.io/spring-boot-configuration-properties/
and
spring-boot/configuration/src/main/java/io/reflectoring/configuration on GitHub

because I am working on utilizing it for the creation of custom properties on my Spring Boot application. Unfortunately, while the information you gave was pretty complete on how to use @ConfiguratioProperties to create configuration properties, there is one pretty major piece of information that is missing:

How do you access the properties once you have defined them and made Spring boot "aware" of them???

Using your properties as an example: you made the MailModuleProperties class to add the twp properties "enabled" and "defaultSubject", and you created two versions of the MailModuleConfiguration class to make a MailModuleProperties instance available to the Spring Boot application. Well and good, but how do you actually access and use the two properties once you make them together?

Suppose I want to create a Controller class with a @GetMapping annotated method that wraps the value of the "defaultSubject" property in some HTML and returns it to a client application or browser? How do I access the MailModuleProperties instance in order to get the property???

I did try to use the @value annotation to set a string to the value of defaultSubject for use in a Controller method, but the string was null when I attempted to use it.

Without that critical piece of information, your information about using @ConfigurationProperties is pretty unusable.

Can you please include an example of how one actually accesses and uses the properties you made in a Controller or Service class?

Spring Boot Validation

Hi,

This is regarding the blog post on spring boot validation.

Under Validating Input to a Spring Service Method, the test for verifying this validation uses @ExtendWith(SpringExtension.class) and @SpringBootTest.

I am trying to keep service layer unit tests free of Spring framework (as recommended here). Unfortunately, unit tests written this way do not trigger validation.

Would be great if you can throw some light on how validation in service layer can be unit tested without using @SpringBootTest. Thanks.

Regards,
Nanda

Missing required configuration "value.serializer" which has no default value.

The spring-boot-kafka example generate this error message, here it is the stack.

org.apache.kafka.common.config.ConfigException: Missing required configuration "value.serializer" which has no default value.
at org.apache.kafka.common.config.ConfigDef.parseValue(ConfigDef.java:477) ~[kafka-clients-2.5.0.jar:na]
at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:467) ~[kafka-clients-2.5.0.jar:na]
at org.apache.kafka.common.config.AbstractConfig.(AbstractConfig.java:108) ~[kafka-clients-2.5.0.jar:na]
at org.apache.kafka.common.config.AbstractConfig.(AbstractConfig.java:129) ~[kafka-clients-2.5.0.jar:na]
at org.apache.kafka.clients.producer.ProducerConfig.(ProducerConfig.java:481) ~[kafka-clients-2.5.0.jar:na]
at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:326) ~[kafka-clients-2.5.0.jar:na]
at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:287) ~[kafka-clients-2.5.0.jar:na]
at org.springframework.kafka.core.DefaultKafkaProducerFactory.createRawProducer(DefaultKafkaProducerFactory.java:645) ~[spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
at org.springframework.kafka.core.DefaultKafkaProducerFactory.createKafkaProducer(DefaultKafkaProducerFactory.java:520) ~[spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
at org.springframework.kafka.core.DefaultKafkaProducerFactory.doCreateProducer(DefaultKafkaProducerFactory.java:497) ~[spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
at org.springframework.kafka.core.DefaultKafkaProducerFactory.createProducer(DefaultKafkaProducerFactory.java:458) ~[spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
at org.springframework.kafka.core.DefaultKafkaProducerFactory.createProducer(DefaultKafkaProducerFactory.java:452) ~[spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
at org.springframework.kafka.core.KafkaTemplate.getTheProducer(KafkaTemplate.java:662) ~[spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
at org.springframework.kafka.core.KafkaTemplate.doSend(KafkaTemplate.java:548) ~[spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
at org.springframework.kafka.core.KafkaTemplate.send(KafkaTemplate.java:360) ~[spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
at io.reflectoring.kafka.KafkaSenderExample.sendMessage(KafkaSenderExample.java:34) ~[classes/:na]
at io.reflectoring.kafka.InitSend.initiateSendingMessage(InitSend.java:36) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:305) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:190) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:153) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.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.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.running(EventPublishingRunListener.java:108) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
at org.springframework.boot.SpringApplicationRunListeners.running(SpringApplicationRunListeners.java:77) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:330) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
at io.reflectoring.kafka.SpringKafkaExampleApplication.main(SpringKafkaExampleApplication.java:12) ~[classes/:na]

2020-12-16 20:46:06.414 INFO 25592 --- [ 1-0-C-1] o.s.k.l.KafkaMessageListenerContainer : reflectoring-user-mc: partitions revoked: [reflectoring-user-0]

Any idea of why this will occur? thanks.

Jacoco gradle with subprojects.

Do you have any idea on how to merge the jacoco reports of a multi module gradle project?

plugins {
    id "org.sonarqube" version "2.7"
    id 'jacoco'
}

def allTestCoverageFile = "${buildDir}/jacoco/allTestCoverage.exec"

// This seems to be a jacoco task which can be used to merge reports.
task jacocoMerge(type: JacocoMerge, group: 'verification') {
    // ??????????????????????????????????????????
}

sonarqube {
    properties {
        property "sonar.scm.provider", "git"
        property "sonar.jacoco.reportPaths", allTestCoverageFile
    }
}

subprojects {
    apply plugin: 'java'
    apply plugin: 'jacoco'

    sonarqube {
        properties {
            property "sonar.jacoco.reportPaths", allTestCoverageFile
        }
    }
}

project(':projectA') {
    dependencies {
        compile project(':projectB')
        compile project(':projectC')
    }
}

project(':projectB') {
    dependencies {
        compile project(':projectC')
    }
}

project(':projectC') {
    dependencies {
    }
}

React Pact example - Need library to be updated

Current package.json has 78 vulnerabilities (65 low, 1 moderate, 12 high)
run npm audit fix to fix them, or npm audit for details

Need to update the below packages
apollo-cache-inmemory ^1.3.9 → ^1.6.3
apollo-client ^2.4.5 → ^2.6.4
apollo-link-http ^1.5.5 → ^1.5.16
axios 0.18.0 → 0.19.0
graphql ^14.0.2 → ^14.5.8
graphql-tag ^2.10.0 → ^2.10.1
node-fetch ^2.2.1 → ^2.6.0
react ^16.5.2 → ^16.10.1
react-dom ^16.5.2 → ^16.10.1
react-scripts 2.0.5 → 3.1.2
@pact-foundation/pact 7.0.3 → 9.1.1
@pact-foundation/pact-node 6.20.0 → 9.0.4
cross-env ^5.2.0 → ^6.0.0

Currently there are FAIL src/rest/hero.service.test.pact.js
● Test suite failed to run

Jest encountered an unexpected token

This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

Here's what you can do:
 • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
 • If you need a custom transformation specify a "transform" option in your config.
 • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html

Can you add a "ProvisioningException" example?

Can you add a "ProvisioningException" example?

What I mean by that is an example of catching exception from a misconfigured Bean on Spring-boot startup where, if the Bean fails, it would shutdown spring-boot?

I encounter exceptions like that far more often than exceptions from my own code. Very tough to find an example of this on the internet.

Update pact javascript examples

Hi there,

I'm one of the pact maintainers, and we occasionally get people asking questions about the examples you have here, which (while instructive) have one or two bugs in the way that jest is used. Is it possible to update the examples to address these issues?

For instance, in the react example, this code doesn't correctly fail if the heroService throws an error, because the catch with done.fail isn't done at the end of the promise chain. This means the test doesn't trigger the appropriate failure in every error case. To address this, you could either move the done.fail part to the end of the promise chain, or return the promise to Jest instead of using done.

        it('sends a request according to contract', (done) => {
            heroService.createHero(new Hero('Superman', 'flying', 'DC'))
                .then(hero => {
                    expect(hero.id).toEqual(42);
                })
                .then(() => {
                    global.provider.verify()
                        .then(() => done(), error => {
                            done.fail(error)
                        })
                });
        });

Another issue is that the pact server is started on every test in jest-wrapper.js. This isn't a bug, but means that the log is quite noisy, which makes it harder to debug. For example, if the pact server starts correctly in a test that doesn't need it, but fails in a test that does, then this is not obvious from the current log. It's probably clearer to only start the server in pact tests.

You can get some of these improvements for free with jest-pact, which was introduced since this example was written, and substantially reduces the need for boilerplate in a jest test. See https://github.com/pact-foundation/jest-pact

You can also entirely avoid the need for publish.js by using the pact-broker CLI directly in your npm script - see: https://github.com/pact-foundation/pact-js#publish-in-npm-scripts

Change Database Healthcheck check with more efficient way to check

Awesome article and found your code for the healthcheck... As a reference for readers, I believe the most efficient way for a probe to verify DB connectivity (network + settings) is to verify if it can retrieve anything... I would change the code at https://github.com/thombergs/code-examples/blob/master/spring-boot/spring-boot-health-check/src/main/java/io/pratik/healthcheck/usersignup/DatabaseHealthContributor.java#L25

  • Mostly (depending on DB vendor)
SELECT 1

https://stackoverflow.com/questions/3668506/efficient-sql-test-query-or-validation-query-that-will-work-across-all-or-most/3670000#3670000

Load exchanges,queues ,binding at startup

Hello,

I tried your sample project on rabbitmq and I've got a question about initialization of configuration for rabbitmq (queues, binding, exchange).

Is there any way to create, on rabbitserver at startup of server spring boot, queues and others ?

Actually, if I don't start the project with your properties to init queues, I need to send a message to rabbit to initiate creation of Queues, bindings...

Thank you.

Git clone doesn't work for liquibase project

When I try: git clone https://github.com/thombergs/code-examples/spring-boot/data-migration/liquibase,

I get this error on my terminal: remote: Not Found fatal: repository 'https://github.com/thombergs/code-examples/spring-boot/data-migration/liquibase/' not found

Bean validation with Spring Boot: validation starter is not included in the web starter

The issue refers to the Validation with Spring Boot - the Complete Guide post, section Using the Spring Boot Validation Starter.

I was following the post to implement validation in my Spring Boot v.2.5.4 project that uses solely spring-boot-starter-web. It turned out that the validation starter does not come for free with the web starter. In fact, I had to manually add the spring-boot-starter-validation dependency to my pom.xml file.

I checked the build.gradle file for this project and the validation starter is also explicitly added.

Could you verify this and amend the post?

for tracing moudule

Hi,

For tracing moudule ,

I got error message:

Internal Server Error (traceId: null)

Can you give me any helps?

Thanks.
Heyang

Usage Part leads misunderstanding

Hi,

I couldn't figure out how to bind one exchange to different queues while there is only on RabbitMQ instance running. I am not sure maybe this can be achieved by running a rabbitmq cluster. Anyway, I think the commands for subscribers in "Usage" part should be like this:

./gradlew bootrun -Dspring.profiles.active=subscriber -Dsubscriber.queue=service1Queue -Dsubscriber.routingKey=customer.*
./gradlew bootrun -Dspring.profiles.active=subscriber -Dsubscriber.queue=service1Queue -Dsubscriber.routingKey=.*created
./gradlew bootrun -Dspring.profiles.active=subscriber -Dsubscriber.queue=service1Queue -Dsubscriber.routingKey=*.*

/master/resilience4j/bulkhead mvn package fails with error

https://github.com/thombergs/code-examples/tree/master/resilience4j/bulkhead

F:\nag\DWork\osource\experiments\java\nfrs\resilience\resilience4j\sb\ex3\bulkhead>mvn build
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------< io.reflectoring.resilience4j.bulkhead:bulkhead >------------------------------------
[INFO] Building bulkhead 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] ---------------------------------------------------------[ jar ]----------------------------------------------------------
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] Total time:  0.155 s
[INFO] Finished at: 2023-08-21T16:51:45+05:30
[INFO] --------------------------------------------------------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "build". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Availa
ble lifecycle phases are: pre-clean, clean, post-clean, validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, pro

F:\nag\DWork\osource\experiments\java\nfrs\resilience\resilience4j\sb\ex3\bulkhead>mvn package
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------< io.reflectoring.resilience4j.bulkhead:bulkhead >------------------------------------
[INFO] Building bulkhead 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] ---------------------------------------------------------[ jar ]----------------------------------------------------------
[INFO] 
[INFO] --- resources:3.0.2:resources (default-resources) @ bulkhead ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory F:\nag\DWork\osource\experiments\java\nfrs\resilience\resilience4j\sb\ex3\bulkhead\src\main\resources
[INFO] skip non existing resourceDirectory F:\nag\DWork\osource\experiments\java\nfrs\resilience\resilience4j\sb\ex3\bulkhead\src\main\resources-filtered
[INFO]
[INFO] --- compiler:3.8.0:compile (default-compile) @ bulkhead ---
[WARNING] The POM for org.apache.maven.wagon:wagon-http:jar:1.0-beta-6 is invalid, transitive dependencies (if any) will not be available, enable verbose output (-X) for more details
[WARNING] The POM for org.apache.maven.wagon:wagon-webdav-jackrabbit:jar:1.0-beta-6 is invalid, transitive dependencies (if any) will not be available, enable verbose output (-X) for more details
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 7 source files to F:\nag\DWork\osource\experiments\java\nfrs\resilience\resilience4j\sb\ex3\bulkhead\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /F:/nag/DWork/osource/experiments/java/nfrs/resilience/resilience4j/sb/ex3/bulkhead/src/main/java/io/reflectoring/resilience4j/bulkhead/utils/RequestTrackingIdPropagator.java:[3,39] cannot find symbol
  symbol:   class ContextPropagator
  location: package io.github.resilience4j.bulkhead
[ERROR] /F:/nag/DWork/osource/experiments/java/nfrs/resilience/resilience4j/sb/ex3/bulkhead/src/main/java/io/reflectoring/resilience4j/bulkhead/utils/RequestTrackingIdPropagator.java:[9,53] cannot find symbol
  symbol: class ContextPropagator
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] Total time:  1.730 s
[INFO] Finished at: 2023-08-21T16:51:57+05:30
[INFO] --------------------------------------------------------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project bulkhead: Compilation failure: Compilation failure:
[ERROR] /F:/nag/DWork/osource/experiments/java/nfrs/resilience/resilience4j/sb/ex3/bulkhead/src/main/java/io/reflectoring/resilience4j/bulkhead/utils/RequestTrackingIdPropagator.java:[3,39] cannot find symbol
[ERROR]   symbol:   class ContextPropagator
[ERROR]   location: package io.github.resilience4j.bulkhead
[ERROR] /F:/nag/DWork/osource/experiments/java/nfrs/resilience/resilience4j/sb/ex3/bulkhead/src/main/java/io/reflectoring/resilience4j/bulkhead/utils/RequestTrackingIdPropagator.java:[9,53] cannot find symbol
[ERROR]   symbol: class ContextPropagator
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the '-e' switch
[ERROR] Re-run Maven using the '-X' switch to enable verbose output
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

F:\nag\DWork\osource\experiments\java\nfrs\resilience\resilience4j\sb\ex3\bulkhead>            


Error EntityManagerFactory

I cloned the project, I did the build and at the time of running it has an error in the creation of the EntityManagerFactory.

KafkaProducerConfig and KafkaProducerConfig are not needed with Spring Boot

Hello, while reading this article I noticed you are declaring KafkaProducerConfig and KafkaConsumerConfig classes.

These classes are not necessary for a Spring Boot application: Spring Boot – unlike Spring – comes with simplified Apache Kafka support by providing auto-configuration, meaning that Kafka configuration is controlled by external configuration properties in spring.kafka.* and does not require to add any Java code.

See the official documentation.

Improvment: OkOrNotFound controller base class method.

I think it would be a better example for your readers to have a controller base class method like:

private static final NOT_FOUND = ResponseEntity.notFound().build();

protected Mono<ResponseEntity<T>> OkOrNotFound(Mono<T> result){
  return result.map(ResponseEntity::ok).defaultIfEmpty(NOT_FOUND);
}

In use it's now just

return OkOrNotFound(result);

Junit Insights not working

In your Spring Boot Test article you reference JUnit-Insights towards the end to gather information about the time it takes to run tests. I'd really like to get this dependency working but I can't get it to work. Do you have any info on how to get it to work?

First off, I can't find the jar anywhere. But I was able to build it with this command:

docker run -v ~/Documents:/hostDocuments -it --user root gradle:4.6-jdk8-alpine sh -c "apk update && apk add git && git clone https://github.com/adessoSE/junit-insights.git && cd junit-insights && gradle jar && cd .. && cp -R junit-insights /hostDocuments/."

And I can get the dependency in my project using the instructions on their readme for local development, but I still can't get any reports to be generated.

I'd appreciate any help I can get to get this to work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.