Skip to content

Commit

Permalink
breaks: Remove deprecations for Micronaut Framework 5 and document br…
Browse files Browse the repository at this point in the history
…eaking changes. (#518)

* Remove deprecations for Micronaut Framework 5 and document breaking changes.

closes #506

* bump up to test-resources 2.3.3

---------

Co-authored-by: Sergio del Amo <[email protected]>
  • Loading branch information
wetted and sdelamo authored Mar 18, 2024
1 parent 36e3f5e commit 6bc96a4
Show file tree
Hide file tree
Showing 18 changed files with 205 additions and 565 deletions.
152 changes: 151 additions & 1 deletion config/accepted-api-changes.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,155 @@
"type": "io.micronaut.jms.pool.SessionPool",
"member": "Constructor io.micronaut.jms.pool.SessionPool(int,int,javax.jms.Connection,io.micronaut.jms.pool.MessageProducerPoolFactory)",
"reason": "Migration from javax.jms to jakarta.jms"
},
{
"type": "io.micronaut.jms.listener.$JMSListenerContainerFactory$Definition$Reference",
"member": "Field $ANNOTATION_METADATA",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.$JMSListenerContainerFactory$Definition$Reference",
"member": "Constructor io.micronaut.jms.listener.$JMSListenerContainerFactory$Definition$Reference()",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.$JMSListenerContainerFactory$Definition$Reference",
"member": "Implemented interface io.micronaut.core.annotation.AnnotationSource",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.$JMSListenerContainerFactory$Definition$Reference",
"member": "Implemented interface io.micronaut.inject.BeanContextConditional",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.$JMSListenerContainerFactory$Definition$Reference",
"member": "Implemented interface io.micronaut.core.annotation.AnnotationMetadataProvider",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.$JMSListenerContainerFactory$Definition$Reference",
"member": "Implemented interface io.micronaut.core.beans.BeanInfo",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.$JMSListenerContainerFactory$Definition$Reference",
"member": "Implemented interface io.micronaut.core.annotation.AnnotationMetadataDelegate",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.$JMSListenerContainerFactory$Definition$Reference",
"member": "Implemented interface io.micronaut.core.annotation.AnnotationMetadata",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.$JMSListenerContainerFactory$Definition$Reference",
"member": "Implemented interface io.micronaut.inject.QualifiedBeanType",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.$JMSListenerContainerFactory$Definition$Reference",
"member": "Implemented interface io.micronaut.core.type.ArgumentCoercible",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.$JMSListenerContainerFactory$Definition$Reference",
"member": "Implemented interface io.micronaut.inject.BeanType",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.$JMSListenerContainerFactory$Definition$Reference",
"member": "Implemented interface io.micronaut.inject.BeanDefinitionReference",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.ConcurrentMessageHandler",
"member": "Constructor io.micronaut.jms.listener.ConcurrentMessageHandler(io.micronaut.jms.listener.MessageHandler,java.util.concurrent.ExecutorService)",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.ConcurrentMessageHandler",
"member": "Constructor io.micronaut.jms.listener.ConcurrentMessageHandler(io.micronaut.jms.listener.MessageHandler)",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.ConcurrentMessageHandler",
"member": "Implemented interface io.micronaut.jms.listener.MessageHandler",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.JMSListener",
"member": "Constructor io.micronaut.jms.listener.JMSListener(javax.jms.Session,javax.jms.MessageListener,io.micronaut.jms.model.JMSDestinationType,java.lang.String,java.util.concurrent.ExecutorService,java.util.Optional)",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.JMSListenerContainer",
"member": "Constructor io.micronaut.jms.listener.JMSListenerContainer(io.micronaut.jms.pool.JMSConnectionPool,io.micronaut.jms.model.JMSDestinationType,int)",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.JMSListenerContainer",
"member": "Constructor io.micronaut.jms.listener.JMSListenerContainer(io.micronaut.jms.pool.JMSConnectionPool,io.micronaut.jms.model.JMSDestinationType,int,int)",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.JMSListenerContainerFactory",
"member": "Constructor io.micronaut.jms.listener.JMSListenerContainerFactory()",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.listener.MessageHandlerAdapter",
"member": "Implemented interface javax.jms.MessageListener",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.pool.JMSConnectionPool",
"member": "Constructor io.micronaut.jms.pool.JMSConnectionPool(javax.jms.ConnectionFactory,int,int)",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.pool.JMSConnectionPool",
"member": "Implemented interface javax.jms.ConnectionFactory",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.pool.MessageProducerPool",
"member": "Constructor io.micronaut.jms.pool.MessageProducerPool(int,int,javax.jms.Session)",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.pool.PooledConnection",
"member": "Constructor io.micronaut.jms.pool.PooledConnection(javax.jms.Connection,io.micronaut.jms.pool.AbstractPool)",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.pool.PooledConnection",
"member": "Implemented interface javax.jms.Connection",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.pool.PooledProducer",
"member": "Constructor io.micronaut.jms.pool.PooledProducer(io.micronaut.jms.pool.AbstractPool,javax.jms.MessageProducer)",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.pool.PooledProducer",
"member": "Implemented interface javax.jms.MessageProducer",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.pool.PooledSession",
"member": "Constructor io.micronaut.jms.pool.PooledSession(io.micronaut.jms.pool.AbstractPool,javax.jms.Session,io.micronaut.jms.pool.MessageProducerPool)",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.pool.PooledSession",
"member": "Implemented interface javax.jms.Session",
"reason": "Removed deprecated code for Micronaut Framework 5"
},
{
"type": "io.micronaut.jms.pool.SessionPool",
"member": "Constructor io.micronaut.jms.pool.SessionPool(int,int,javax.jms.Connection,io.micronaut.jms.pool.MessageProducerPoolFactory)",
"reason": "Removed deprecated code for Micronaut Framework 5"
}
]
]
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package io.micronaut.jms.docs.binding

import io.micronaut.context.annotation.Requires
import io.micronaut.core.annotation.Nullable


// tag::imports[]
import io.micronaut.core.annotation.Nullable

import io.micronaut.jms.annotations.JMSListener
import io.micronaut.jms.annotations.Message
import io.micronaut.jms.annotations.Queue
import io.micronaut.messaging.annotation.MessageBody
import io.micronaut.messaging.annotation.MessageHeader

import jakarta.jms.Destination

import static io.micronaut.jms.activemq.classic.configuration.ActiveMqClassicConfiguration.CONNECTION_FACTORY_BEAN_NAME
Expand All @@ -22,8 +24,8 @@ import static io.micronaut.jms.model.JMSHeaders.JMS_REDELIVERED
import static io.micronaut.jms.model.JMSHeaders.JMS_REPLY_TO
import static io.micronaut.jms.model.JMSHeaders.JMS_TIMESTAMP
import static io.micronaut.jms.model.JMSHeaders.JMS_TYPE

// end::imports[]
import io.micronaut.context.annotation.Requires

@Requires(property = 'spec.name', value = 'BindingSpec')
// tag::clazz[]
Expand All @@ -34,7 +36,7 @@ class MapConsumer {
List<Map<String, Object>> messageHeaders = [].asSynchronized()
List<jakarta.jms.Message> messages = [].asSynchronized()

@Queue(value = 'queue_map', concurrency = '1-5')
@Queue(value = 'queue_map')
void receive(@MessageBody Map<String, Serializable> body,
@Message jakarta.jms.Message message,
@MessageHeader(JMS_CORRELATION_ID) @Nullable String correlationId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ package io.micronaut.jms.docs.exceptions

import io.micronaut.context.annotation.Requires
import io.micronaut.jms.annotations.JMSListener
import io.micronaut.jms.annotations.Queue

// tag::imports[]

import io.micronaut.jms.annotations.Queue
import io.micronaut.jms.listener.JMSListenerErrorHandler
import io.micronaut.messaging.annotation.MessageBody
import jakarta.inject.Singleton

import jakarta.jms.Message
import jakarta.jms.Session

Expand All @@ -24,7 +23,7 @@ class ErrorThrowingConsumer {

Collection<String> messages = Collections.synchronizedSet(new HashSet<String>())

@Queue(value = "error-queue", concurrency = "1-1", errorHandlers = [CountingErrorHandler.class]) // <2>
@Queue(value = "error-queue", errorHandlers = [CountingErrorHandler.class]) // <2>
void receive(@MessageBody String message) {
if (message == "throw an error") {
throw new RuntimeException("this is an error") // <3>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package io.micronaut.jms.docs.quickstart

// tag::imports[]
import io.micronaut.context.annotation.Requires
import io.micronaut.jms.annotations.JMSListener

// tag::imports[]

import io.micronaut.jms.annotations.Queue
import io.micronaut.messaging.annotation.MessageBody

import static io.micronaut.jms.activemq.classic.configuration.ActiveMqClassicConfiguration.CONNECTION_FACTORY_BEAN_NAME

// end::imports[]
import io.micronaut.context.annotation.Requires

@Requires(property = 'spec.name', value = 'QuickstartSpec')
// tag::clazz[]
Expand All @@ -16,7 +19,7 @@ class TextConsumer {

List<String> messages = [].asSynchronized()

@Queue(value = 'queue_text', concurrency = '1-5') // <2>
@Queue(value = 'queue_text') // <2>
void receive(@MessageBody String body) { // <3>
messages << body
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import io.micronaut.context.annotation.Requires
import io.micronaut.jms.annotations.JMSListener
import io.micronaut.jms.annotations.Queue
import io.micronaut.jms.listener.JMSListenerSuccessHandler
import io.micronaut.messaging.annotation.MessageBody

// tag::imports[]

import io.micronaut.messaging.annotation.MessageBody
import jakarta.inject.Singleton

import jakarta.jms.Message
import jakarta.jms.Session

import java.util.concurrent.atomic.AtomicInteger

import static io.micronaut.jms.activemq.classic.configuration.ActiveMqClassicConfiguration.CONNECTION_FACTORY_BEAN_NAME
Expand All @@ -25,7 +25,7 @@ class SuccessHandlingConsumer {

Collection<String> messages = Collections.synchronizedSet(new HashSet<String>())

@Queue(value = "success-queue", concurrency = "1-1", successHandlers = [CountingSuccessHandler.class]) // <2>
@Queue(value = "success-queue", successHandlers = [CountingSuccessHandler.class]) // <2>
void receive(@MessageBody String message) {
messages.add(message)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
package io.micronaut.jms.docs.binding

import io.micronaut.context.annotation.Requires
// tag::imports[]
import io.micronaut.context.annotation.Requires
import io.micronaut.jms.activemq.classic.configuration.ActiveMqClassicConfiguration.CONNECTION_FACTORY_BEAN_NAME
import io.micronaut.jms.annotations.JMSListener
import io.micronaut.jms.annotations.Message
import io.micronaut.jms.annotations.Queue
import io.micronaut.jms.model.JMSHeaders.JMS_CORRELATION_ID
import io.micronaut.jms.model.JMSHeaders.JMS_DELIVERY_MODE
import io.micronaut.jms.model.JMSHeaders.JMS_DESTINATION
import io.micronaut.jms.model.JMSHeaders.JMS_EXPIRATION
import io.micronaut.jms.model.JMSHeaders.JMS_MESSAGE_ID
import io.micronaut.jms.model.JMSHeaders.JMS_PRIORITY
import io.micronaut.jms.model.JMSHeaders.JMS_REDELIVERED
import io.micronaut.jms.model.JMSHeaders.JMS_REPLY_TO
import io.micronaut.jms.model.JMSHeaders.JMS_TIMESTAMP
import io.micronaut.jms.model.JMSHeaders.JMS_TYPE
import io.micronaut.jms.model.JMSHeaders.*
import io.micronaut.messaging.annotation.MessageBody
import io.micronaut.messaging.annotation.MessageHeader
import java.io.Serializable
import jakarta.jms.Destination
import java.io.Serializable

// end::imports[]

@Requires(property = "spec.name", value = "BindingSpec")
Expand All @@ -31,7 +23,7 @@ class MapConsumer {
val messageHeaders = mutableListOf<Map<String, Any?>>()
val messages = mutableListOf<jakarta.jms.Message>()

@Queue(value = "queue_map", concurrency = "1-5")
@Queue(value = "queue_map")
fun receive(
@MessageBody body: Map<String, Serializable>,
@Message message: jakarta.jms.Message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import io.micronaut.jms.annotations.Queue
import io.micronaut.jms.listener.JMSListenerErrorHandler
import io.micronaut.messaging.annotation.MessageBody
import jakarta.inject.Singleton
import java.util.*
import java.util.concurrent.atomic.AtomicInteger
import jakarta.jms.Message
import jakarta.jms.Session
import java.util.*
import java.util.concurrent.atomic.AtomicInteger

// end::imports[]

Expand All @@ -24,7 +24,6 @@ class ErrorThrowingConsumer {

@Queue(
value = "error-queue",
concurrency = "1-1",
errorHandlers = [CountingErrorHandler::class]) // <2>
fun receive(@MessageBody message: String) {
if (message == "throw an error") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package io.micronaut.jms.docs.quickstart

// tag::imports[]
// end::imports[]
import io.micronaut.context.annotation.Requires
import io.micronaut.jms.activemq.classic.configuration.ActiveMqClassicConfiguration.CONNECTION_FACTORY_BEAN_NAME
import io.micronaut.jms.annotations.JMSListener
import io.micronaut.jms.annotations.Queue
import io.micronaut.messaging.annotation.MessageBody
import java.util.ArrayList
import java.util.Collections
// end::imports[]
import io.micronaut.context.annotation.Requires
import java.util.*

@Requires(property = "spec.name", value = "QuickstartSpec")
// tag::clazz[]
Expand All @@ -17,7 +16,7 @@ class TextConsumer {

val messages: MutableList<String> = Collections.synchronizedList(ArrayList())

@Queue(value = "queue_text", concurrency = "1-5") // <2>
@Queue(value = "queue_text") // <2>
fun receive(@MessageBody body: String) { // <3>
messages.add(body)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import io.micronaut.jms.annotations.Queue
import io.micronaut.jms.listener.JMSListenerSuccessHandler
import io.micronaut.messaging.annotation.MessageBody
import jakarta.inject.Singleton
import java.util.*
import java.util.concurrent.atomic.AtomicInteger
import jakarta.jms.Message
import jakarta.jms.Session
import java.util.*
import java.util.concurrent.atomic.AtomicInteger

// end::imports[]

Expand All @@ -24,7 +24,6 @@ class SuccessHandlingConsumer {

@Queue(
value = "success-queue",
concurrency = "1-1",
successHandlers = [CountingSuccessHandler::class]) // <2>
fun receive(@MessageBody message: String) {
processed.add(message)
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ micronaut-docs = "2.0.0"
micronaut = "4.3.11"
micronaut-test = "4.1.1"
micronaut-aws = "4.4.3"
micronaut-test-resources = "2.3.2"
micronaut-test-resources = "2.3.3"
micronaut-platform = "4.2.3"
amazon-sqs-messaging = '2.1.2'
micronaut-validation = "4.4.4"
Expand Down
Loading

0 comments on commit 6bc96a4

Please sign in to comment.