- Distributed Polling with SKIP LOCKED
- https://www.evernote.com/client/web#?an=true&fs=true&n=93f6cdf2-633d-4051-8b99-7e2d05498ead&s=s173&
- https://gist.github.com/rponte/0c5b0e3c1b84c0c2e49c863215c2c0f4
- https://gist.github.com/rponte/5e8d41fd3b2ced22206dce788208c30b (Implementing, rewriting, and rebuilding a task queue - by @tef_ebooks)
- https://todd-hubers.medium.com/you-really-can-replace-kafka-with-a-database-9e82a7c248a6 (Replacing Kafka with a database?)
- https://www.cloudamqp.com/blog/2015-11-23-why-is-a-database-not-the-right-tool-for-a-queue-based-system.html
- https://viralpatel.net/blogs/oracle-skip-locked/
- https://vladmihalcea.com/database-job-queue-skip-locked/
- https://github.com/vladmihalcea/high-performance-java-persistence/blob/master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/concurrency/SkipLockJobQueueTest.java#L186
- https://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibernate_User_Guide.html#locking-follow-on
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
apply plugin: 'java' | |
apply plugin: 'eclipse' | |
sourceCompatibility = JavaVersion.VERSION_1_8 | |
targetCompatibility = JavaVersion.VERSION_1_8 | |
eclipseJdt << { | |
ant.propertyfile(file: ".settings/org.eclipse.core.resources.prefs") { | |
ant.entry(key: "eclipse.preferences.version", value: "1") | |
ant.entry(key: "encoding/<project>", value: "utf-8") |
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 br.com.zup.edu.minhasfigurinhas; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | |
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | |
import static org.springframework.http.HttpMethod.GET; | |
import static org.springframework.http.HttpMethod.POST; | |
import static org.springframework.security.config.http.SessionCreationPolicy.STATELESS; |
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 br.com.stackspot.nullbank.withdrawal; | |
import org.hibernate.LockOptions; | |
import org.springframework.data.jpa.repository.*; | |
import org.springframework.stereotype.Repository; | |
import javax.persistence.LockModeType; | |
import javax.persistence.QueryHint; | |
import javax.transaction.Transactional; | |
import java.util.Optional; |
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 br.com.rponte.base.spring.config.env; | |
import org.junit.rules.ExternalResource; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.core.env.ConfigurableEnvironment; | |
import org.springframework.mock.env.MockPropertySource; | |
import org.springframework.stereotype.Component; | |
/** | |
* https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/env/ConfigurableEnvironment.html |
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 br.com.mdias.rponte.signature; | |
import java.util.Base64; | |
/** | |
* Represents a signed XML | |
*/ | |
public class SignedXml { | |
private String content; |
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
facesContext.getExternalContext().getFlash().setKeepMessages(true); | |
// more informations | |
// http://stackoverflow.com/questions/5137601/preserving-facesmessage-after-redirect-for-presentation-through-hmessage-in-js |
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
-- Tendo problemas com "ORA-12519, TNS:no appropriate service handler found"? | |
-- dica: http://en.newinstance.it/2007/06/01/ora-12519-tnsno-appropriate-service-handler-found/ | |
-- Basta rodar este comando e reiniciar o listener (OracleXETNSListener): | |
ALTER SYSTEM SET PROCESSES=150 SCOPE=SPFILE; |
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 br.com.zup.edu.ifoodwebapp.samples.books; | |
import base.SpringDataJpaIntegrationTest; | |
import org.junit.jupiter.api.BeforeEach; | |
import org.junit.jupiter.api.DisplayName; | |
import org.junit.jupiter.api.Test; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.dao.DataIntegrityViolationException; | |
import org.springframework.transaction.TransactionSystemException; |
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
/** | |
* This Spring Boot controller was implemented as an example of a simple but robust idempotent REST API that | |
* leverages the ACID properties of a relational database. | |
*/ | |
@RestController | |
public class CreateNewUserController { | |
@Autowired | |
private UserRepository repository; | |
@Autowired |