From 2f5b55701025410601c604bc881f7b057eb1a88d Mon Sep 17 00:00:00 2001 From: Krishnananthalingam Tharmigan <63336800+TharmiganK@users.noreply.github.com> Date: Mon, 21 Aug 2023 15:28:48 +0530 Subject: [PATCH 1/4] Add proxy configs --- .../native-image/org.ballerinax/native/proxy-config.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 native/src/main/resources/META-INF/native-image/org.ballerinax/native/proxy-config.json diff --git a/native/src/main/resources/META-INF/native-image/org.ballerinax/native/proxy-config.json b/native/src/main/resources/META-INF/native-image/org.ballerinax/native/proxy-config.json new file mode 100644 index 00000000..4f3c9aea --- /dev/null +++ b/native/src/main/resources/META-INF/native-image/org.ballerinax/native/proxy-config.json @@ -0,0 +1,7 @@ +[ + { + "interfaces": [ + "com.azure.messaging.servicebus.administration.implementation.EntitiesImpl$EntitiesService" + ] + } +] From 6b6ae67ae426df581f459f44ce42723ef71dc902 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Mon, 21 Aug 2023 15:30:16 +0530 Subject: [PATCH 2/4] Change native image directory --- .../{native => azure-service-bus-native}/native-image.properties | 0 .../{native => azure-service-bus-native}/proxy-config.json | 0 .../{native => azure-service-bus-native}/reflect-config.json | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename native/src/main/resources/META-INF/native-image/org.ballerinax/{native => azure-service-bus-native}/native-image.properties (100%) rename native/src/main/resources/META-INF/native-image/org.ballerinax/{native => azure-service-bus-native}/proxy-config.json (100%) rename native/src/main/resources/META-INF/native-image/org.ballerinax/{native => azure-service-bus-native}/reflect-config.json (100%) diff --git a/native/src/main/resources/META-INF/native-image/org.ballerinax/native/native-image.properties b/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/native-image.properties similarity index 100% rename from native/src/main/resources/META-INF/native-image/org.ballerinax/native/native-image.properties rename to native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/native-image.properties diff --git a/native/src/main/resources/META-INF/native-image/org.ballerinax/native/proxy-config.json b/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/proxy-config.json similarity index 100% rename from native/src/main/resources/META-INF/native-image/org.ballerinax/native/proxy-config.json rename to native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/proxy-config.json diff --git a/native/src/main/resources/META-INF/native-image/org.ballerinax/native/reflect-config.json b/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/reflect-config.json similarity index 100% rename from native/src/main/resources/META-INF/native-image/org.ballerinax/native/reflect-config.json rename to native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/reflect-config.json From 9999928a4f85cbaf32fca292c78d0b37181ed2e8 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Mon, 21 Aug 2023 16:40:34 +0530 Subject: [PATCH 3/4] Add missing native image configurations --- .../proxy-config.json | 20 + .../reflect-config.json | 562 ++++++++++++++++++ .../resource-config.json | 16 + 3 files changed, 598 insertions(+) create mode 100644 native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/resource-config.json diff --git a/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/proxy-config.json b/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/proxy-config.json index 4f3c9aea..0d41593e 100644 --- a/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/proxy-config.json +++ b/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/proxy-config.json @@ -3,5 +3,25 @@ "interfaces": [ "com.azure.messaging.servicebus.administration.implementation.EntitiesImpl$EntitiesService" ] + }, + { + "interfaces": [ + "com.azure.messaging.servicebus.administration.implementation.NamespacesImpl$NamespacesService" + ] + }, + { + "interfaces": [ + "com.azure.messaging.servicebus.administration.implementation.RulesImpl$RulesService" + ] + }, + { + "interfaces": [ + "com.azure.messaging.servicebus.administration.implementation.ServiceBusManagementClientImpl$ServiceBusManagementClientService" + ] + }, + { + "interfaces": [ + "com.azure.messaging.servicebus.administration.implementation.SubscriptionsImpl$SubscriptionsService" + ] } ] diff --git a/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/reflect-config.json b/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/reflect-config.json index 0db1c98c..dd782166 100644 --- a/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/reflect-config.json +++ b/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/reflect-config.json @@ -1,4 +1,92 @@ [ + { + "name": "com.azure.core.amqp.implementation.AmqpChannelProcessor", + "fields": [ + { + "name": "upstream" + } + ] + }, + { + "name": "com.azure.core.amqp.models.CbsAuthorizationType", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.core.http.HttpHeaderName", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.core.http.netty.implementation.AzureSdkHandler", + "methods": [ + { + "name": "channelRead", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object" + ] + }, + { + "name": "channelReadComplete", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext" + ] + }, + { + "name": "write", + "parameterTypes": [ + "io.netty.channel.ChannelHandlerContext", + "java.lang.Object", + "io.netty.channel.ChannelPromise" + ] + } + ] + }, + { + "name": "com.azure.core.util.ExpandableStringEnum", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "methods": [ + { + "name": "toString", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.core.util.Header", + "fields": [ + { + "name": "cachedStringValue" + } + ] + }, + { + "name": "com.azure.core.util.QueryParameter", + "fields": [ + { + "name": "cachedStringValue" + } + ] + }, + { + "name": "com.azure.messaging.servicebus.ServiceBusErrorSource", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, { "name": "com.azure.messaging.servicebus.ServiceBusFailureReason", "methods": [ @@ -7,5 +95,479 @@ "parameterTypes": [] } ] + }, + { + "name": "com.azure.messaging.servicebus.SynchronousMessageSubscriber", + "fields": [ + { + "name": "requested" + }, + { + "name": "upstream" + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.AuthorizationRuleImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.AuthorizationRuleImpl$RightsWrapper", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.CreateQueueBodyContentImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.CreateQueueBodyImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.CreateRuleBodyContentImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.CreateRuleBodyImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.CreateSubscriptionBodyContentImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.CreateSubscriptionBodyImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.CreateTopicBodyContentImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.CreateTopicBodyImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.EmptyRuleActionImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.EntityAvailabilityStatusImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + }, + { + "name": "fromString", + "parameterTypes": [ + "java.lang.String" + ] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.KeyValueImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.MessageCountDetailsImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.QueueDescriptionEntryContentImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.QueueDescriptionEntryImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.QueueDescriptionImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.QueueDescriptionImpl$AuthorizationRulesWrapper", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.ResponseAuthorImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.ResponseLinkImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.RuleActionImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.RuleDescriptionEntryContentImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.RuleDescriptionEntryImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.RuleDescriptionFeedImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.RuleDescriptionImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.RuleFilterImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.ServiceBusManagementError", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.ServiceBusManagementErrorException", + "methods": [ + { + "name": "", + "parameterTypes": [ + "java.lang.String", + "com.azure.core.http.HttpResponse", + "com.azure.messaging.servicebus.administration.implementation.models.ServiceBusManagementError" + ] + }, + { + "name": "getValue", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.SqlFilterImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.SqlFilterImpl$ParametersWrapper", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.SqlRuleActionImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.SqlRuleActionImpl$ParametersWrapper", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.SubscriptionDescriptionEntryContentImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.SubscriptionDescriptionEntryImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.SubscriptionDescriptionFeedImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.SubscriptionDescriptionImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.TitleImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.TopicDescriptionEntryContentImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.TopicDescriptionEntryImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.TopicDescriptionImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.TopicDescriptionImpl$AuthorizationRulesWrapper", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.implementation.models.TrueFilterImpl", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.models.AccessRights", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "com.azure.messaging.servicebus.administration.models.EntityStatus", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + }, + { + "name": "fromString", + "parameterTypes": [ + "java.lang.String" + ] + } + ] + }, + { + "name": "com.azure.messaging.servicebus.administration.models.QueueProperties" + }, + { + "name": "com.azure.messaging.servicebus.administration.models.RuleProperties" + }, + { + "name": "com.azure.messaging.servicebus.administration.models.SubscriptionProperties" + }, + { + "name": "com.azure.messaging.servicebus.administration.models.TopicProperties" + }, + { + "name": "com.azure.messaging.servicebus.implementation.ServiceBusReceiveLinkProcessor", + "fields": [ + { + "name": "requested" + }, + { + "name": "upstream" + } + ] + }, + { + "name": "com.azure.xml.XmlSerializable" } ] diff --git a/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/resource-config.json b/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/resource-config.json new file mode 100644 index 00000000..d239eaba --- /dev/null +++ b/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/resource-config.json @@ -0,0 +1,16 @@ +{ + "resources": { + "includes": [ + { + "pattern": "\\QMETA-INF/services/com.azure.core.http.HttpClientProvider\\E" + }, + { + "pattern": "\\Qazure-core.properties\\E" + }, + { + "pattern": "\\Qazure-messaging-servicebus.properties\\E" + } + ] + }, + "bundles": [] +} From 4727ec8ea9c901cbb16ff16ef0fd317b3a2f0a8b Mon Sep 17 00:00:00 2001 From: Krishnananthalingam Tharmigan <63336800+TharmiganK@users.noreply.github.com> Date: Wed, 23 Aug 2023 10:11:44 +0530 Subject: [PATCH 4/4] Fix illegal access warning --- .../azure-service-bus-native/native-image.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/native-image.properties b/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/native-image.properties index a98065ca..c3082a4e 100644 --- a/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/native-image.properties +++ b/native/src/main/resources/META-INF/native-image/org.ballerinax/azure-service-bus-native/native-image.properties @@ -14,4 +14,5 @@ # specific language governing permissions and limitations # under the License. -Args = --initialize-at-build-time=org.slf4j +Args = --initialize-at-build-time=org.slf4j \ + -J--add-opens=java.base/java.nio=ALL-UNNAMED