java

Commit Asynchronously a message just after reading from topic

笑着哭i 提交于 2021-02-19 03:25:08
问题 I'm trying to commit a message just after reading it from the topic. I've followed this link (https://www.confluent.io/blog/apache-kafka-spring-boot-application) to create a Kafka consumer with spring. Normally it works perfect and the consumer gets the message and waits till anotherone enters in the queue. But the problem is that when I process this messages it takes a lot of time (circa 10 minutes) the kafka queue thinks that the message is not consumed (commited) and the consumers reads it

How do I force tomcat to reload trusted certificates?

試著忘記壹切 提交于 2021-02-19 03:22:47
问题 My WebApp uses a Connector for 2-Way SSL (aka "Client Authentication"): <Connector port="8084" SSLEnabled="true" maxThreads="10" minSpareThreads="3" maxSpareThreads="5" enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" clientAuth="true" truststoreFile="conf/keystore.kst" truststoreType="JCEKS" sslProtocol="TLS" URIEncoding="UTF-8" keystoreFile="conf/keystore.kst" keystoreType="JCEKS" keyAlias="myAlias" ciphers="TLS_RSA_WITH_AES_128_CBC_SHA,TLS

How do I force tomcat to reload trusted certificates?

穿精又带淫゛_ 提交于 2021-02-19 03:22:28
问题 My WebApp uses a Connector for 2-Way SSL (aka "Client Authentication"): <Connector port="8084" SSLEnabled="true" maxThreads="10" minSpareThreads="3" maxSpareThreads="5" enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" clientAuth="true" truststoreFile="conf/keystore.kst" truststoreType="JCEKS" sslProtocol="TLS" URIEncoding="UTF-8" keystoreFile="conf/keystore.kst" keystoreType="JCEKS" keyAlias="myAlias" ciphers="TLS_RSA_WITH_AES_128_CBC_SHA,TLS

java.time.zone.ZoneRulesProvider for Microsoft time-zones

∥☆過路亽.° 提交于 2021-02-19 03:18:55
问题 I am coding against an external API that returns what appear to be windows time-zone descriptions as strings e.g. "Romance Standard Time", and I need to parse these into java ZoneId s or offsets. A list of these values is available here. The java.time.ZoneId documentation states: Time-zone rules are defined by governments and change frequently. There are a number of organizations, known here as groups, that monitor time-zone changes and collate them. The default group is the IANA Time Zone

JAR files created by IntelliJ IDEA do not run

半腔热情 提交于 2021-02-19 03:18:47
问题 I wrote a program that spans a few classes in IntelliJ and it works fine when I was testing it in the IDE. However, whenever I follow tutorials to make my project into a .jar executable, it does not run. The file in the out folder does not run when double-click on it and says "The Java JAR file "projectName.jar" could not be launched. When opening it from the terminal, I get the error "Could not find or load main class". I used "$ java -jar projectName.jar " I followed these steps: Open

H2 database doesn't work in memory only with file

寵の児 提交于 2021-02-19 03:17:57
问题 I have a Spring MVC project set up with Hibernate and wanted to create some tests for some Services. The main application uses a PostgreSQL database and for tests I want to use H2 in memory database I created separate configuration files for the tests (both Spring and Hibernate) Everything works well until I try to hit the in memory database Hibernate configuration: @Configuration @EnableTransactionManagement @EnableJpaRepositories("<repository>") public class DataSourceTestConfig { private

H2 database doesn't work in memory only with file

↘锁芯ラ 提交于 2021-02-19 03:16:44
问题 I have a Spring MVC project set up with Hibernate and wanted to create some tests for some Services. The main application uses a PostgreSQL database and for tests I want to use H2 in memory database I created separate configuration files for the tests (both Spring and Hibernate) Everything works well until I try to hit the in memory database Hibernate configuration: @Configuration @EnableTransactionManagement @EnableJpaRepositories("<repository>") public class DataSourceTestConfig { private

JAR files created by IntelliJ IDEA do not run

点点圈 提交于 2021-02-19 03:16:19
问题 I wrote a program that spans a few classes in IntelliJ and it works fine when I was testing it in the IDE. However, whenever I follow tutorials to make my project into a .jar executable, it does not run. The file in the out folder does not run when double-click on it and says "The Java JAR file "projectName.jar" could not be launched. When opening it from the terminal, I get the error "Could not find or load main class". I used "$ java -jar projectName.jar " I followed these steps: Open

H2 database doesn't work in memory only with file

我的未来我决定 提交于 2021-02-19 03:15:08
问题 I have a Spring MVC project set up with Hibernate and wanted to create some tests for some Services. The main application uses a PostgreSQL database and for tests I want to use H2 in memory database I created separate configuration files for the tests (both Spring and Hibernate) Everything works well until I try to hit the in memory database Hibernate configuration: @Configuration @EnableTransactionManagement @EnableJpaRepositories("<repository>") public class DataSourceTestConfig { private

How can an object be created from a static block?

对着背影说爱祢 提交于 2021-02-19 03:14:42
问题 Consider two classes in a default package : class Trial { int a; int b; public static void main (String [] args){ System.out.println("test base"); } } public class TrialExe { int a; int b; public static void main (String [] args){ Trial t = new Trial(); System.out.println("test exe"); } } Compiling TrialExe: javac TrialExe How can this compile?. Considering that the Trial object is created from a static block, to create an object the constructor of Trial is required, but as far as I know we