View bootstrap-otimizado.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring: | |
jpa: | |
hibernate.ddl-auto: none | |
properties: | |
hibernate: | |
dialect: org.hibernate.dialect.PostgreSQLDialect | |
temp.use_jdbc_metadata_defaults: false |
View podman-compose-install.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From https://www.educative.io/edpresso/installing-pip3-in-ubuntu | |
sudo apt-get -y install python3-pip | |
# From https://github.com/containers/podman-compose | |
pip3 install podman-compose |
View application-kafka.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring.kafka.consumer.auto-offset-reset=earliest | |
spring.kafka.consumer.enable-auto-commit=true | |
spring.kafka.consumer.max-poll-records=100 | |
spring.kafka.consumer.fetch-max-wait=2s | |
spring.kafka.listener.type=BATCH | |
spring.kafka.listener.concurrency=12 | |
spring.kafka.consumer.group-id=batchTest1 | |
spring.kafka.client-id=batchTest1 | |
spring.kafka.listener.ack-mode=BATCH |
View application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server.error.include-stacktrace=never # when to include a stacktrace attribute (never/alway/on-trace-param) |
View CustomErrorAttibutes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demo.config; | |
import org.springframework.boot.web.error.ErrorAttributeOptions; | |
import org.springframework.boot.web.servlet.error.DefaultErrorAttributes; | |
import org.springframework.stereotype.Component; | |
import org.springframework.web.context.request.WebRequest; | |
import java.util.Map; | |
@Component |
View RepositoryTestWithOracle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@DataJpaTest | |
@ActiveProfiles("test") | |
/* | |
By default @DataJpaTest uses embeded h2 database and ignores the connection string declared in application.properties. | |
This annotation disables this behavior and db configured in bootstrap.yml will be used by @DataJpaTest test. | |
*/ | |
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE) | |
@Sql("classpath:my_data.sql") | |
class MyRepositoryTest { | |
} |
View h2.dump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SCRIPT TO 'db-dump.sql' |
View docker.jmx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -d --restart=always | |
\ | |
-p {{service_port}}:8080 | |
-p {{jmx_port}}:{{jmx_port}} | |
\ | |
-e JAVA_OPTS=' | |
-Xmx{{java_memory_limit}} | |
-XX:+UseConcMarkSweepGC | |
-XX:NativeMemoryTracking=summary |
View docker.jmx.v2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --rm -it -p 8080:8080 -p 9010:9010 -e JAVA_TOOL_OPTIONS=' | |
-Xmx450M | |
-XX:+UseConcMarkSweepGC | |
-XX:NativeMemoryTracking=summary | |
-Djava.rmi.server.hostname=127.0.0.1 | |
-Dcom.sun.management.jmxremote | |
-Dcom.sun.management.jmxremote.port=9010 | |
-Dcom.sun.management.jmxremote.rmi.port=9010 | |
-Dcom.sun.management.jmxremote.local.only=false | |
-Dcom.sun.management.jmxremote.authenticate=false |
View jpa_spring_log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring: | |
jpa: | |
show-sql: true | |
properties.hibernate.format_sql: true |
NewerOlder