From da5e7020c0da3a2483fc9c2bc1a694e9a51fa000 Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Mon, 25 Jan 2021 15:30:01 +0100 Subject: [PATCH 1/3] Upgraded to Grails 4 - tests passing --- build.gradle | 86 ++++++++++---- gradle.properties | 8 +- gradle/wrapper/gradle-wrapper.properties | 3 +- grails-app/conf/application.groovy | 36 ------ grails-app/conf/application.yml | 112 ++++++++++++++++++ grails-app/conf/plugin.groovy | 2 +- .../plugin/asyncmail/Application.groovy | 4 +- .../AsynchronousMailPersistenceService.groovy | 2 + .../AsynchronousMailProcessService.groovy | 2 + .../asyncmail/AsyncMailServiceSpec.groovy | 3 +- .../AsynchronousMailConfigServiceSpec.groovy | 4 +- ...nchronousMailPersistenceServiceSpec.groovy | 2 +- ...usMailProcessServiceIntegrationSpec.groovy | 2 +- .../AsynchronousMailServiceSpec.groovy | 2 +- .../AsynchronousMailGrailsPlugin.groovy | 2 +- 15 files changed, 193 insertions(+), 77 deletions(-) delete mode 100644 grails-app/conf/application.groovy create mode 100644 grails-app/conf/application.yml diff --git a/build.gradle b/build.gradle index 9f9ba3a..4f64745 100644 --- a/build.gradle +++ b/build.gradle @@ -1,65 +1,94 @@ buildscript { repositories { - mavenLocal() maven { url "https://repo.grails.org/grails/core" } } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsVersion" - classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.2" + classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.0.10" + classpath "org.grails.plugins:hibernate5:7.0.4" } } -version "2.0.2" +version "3.0.0" group "org.grails.plugins" +apply plugin:"eclipse" apply plugin: 'idea' apply plugin:"org.grails.grails-plugin" apply plugin:"org.grails.grails-plugin-publish" -apply plugin:"org.grails.grails-gsp" apply plugin:"asset-pipeline" - -ext { - grailsVersion = project.grailsVersion - gradleWrapperVersion = project.gradleWrapperVersion -} +apply plugin:"org.grails.grails-gsp" repositories { - mavenLocal() maven { url "https://repo.grails.org/grails/core" } } +configurations { + developmentOnly + runtimeClasspath { + extendsFrom developmentOnly + } +} + dependencies { + developmentOnly("org.springframework.boot:spring-boot-devtools") compile "org.springframework.boot:spring-boot-starter-logging" compile "org.springframework.boot:spring-boot-autoconfigure" compile "org.grails:grails-core" compile "org.springframework.boot:spring-boot-starter-actuator" compile "org.springframework.boot:spring-boot-starter-tomcat" - compile "org.grails:grails-dependencies" compile "org.grails:grails-web-boot" + compile "org.grails:grails-logging" + compile "org.grails:grails-plugin-rest" + compile "org.grails:grails-plugin-databinding" + compile "org.grails:grails-plugin-i18n" + compile "org.grails:grails-plugin-services" + compile "org.grails:grails-plugin-url-mappings" + compile "org.grails:grails-plugin-interceptors" compile "org.grails.plugins:cache" + compile "org.grails.plugins:async" compile "org.grails.plugins:scaffolding" + compile "org.grails.plugins:hibernate5" + compile "org.hibernate:hibernate-core:5.4.18.Final" + compile "org.grails.plugins:mongodb" + compile "org.grails.plugins:gsp" + compile "org.grails.plugins:mail:3.0.0" + // This is needed for the quartz-plugin on grails 4.0.x, https://github.com/grails-plugins/grails-quartz/issues/107#issuecomment-575951471 + compile("org.quartz-scheduler:quartz:2.2.3") { + exclude group: 'slf4j-api', module: 'c3p0' + } + compile ('org.grails.plugins:quartz:2.0.13') + compileOnly "io.micronaut:micronaut-inject-groovy" console "org.grails:grails-console" profile "org.grails.profiles:web-plugin" - provided "org.grails:grails-plugin-services" - provided "org.grails:grails-plugin-domain-class" - + runtime "org.apache.tomcat:tomcat-jdbc" + runtime "com.bertramlabs.plugins:asset-pipeline-grails:3.0.10" + testCompile "io.micronaut:micronaut-inject-groovy" testCompile "org.grails:grails-gorm-testing-support" - testCompile "net.bytebuddy:byte-buddy:1.7.9" - testCompile "org.grails.plugins:hibernate5" - testCompile "com.h2database:h2:1.4.196" - - compile "org.grails.plugins:mail:2.0.0" - compile "org.grails.plugins:quartz:2.0.13" + testCompile "org.mockito:mockito-core" + testCompile "org.grails:grails-web-testing-support" } -assets { - packagePlugin = true +bootRun { + ignoreExitValue true + jvmArgs( + '-Dspring.output.ansi.enabled=always', + '-noverify', + '-XX:TieredStopAtLevel=1', + '-Xmx1024m') + sourceResources sourceSets.main + String springProfilesActive = 'spring.profiles.active' + systemProperty springProfilesActive, System.getProperty(springProfilesActive) } -task wrapper(type: Wrapper) { - gradleVersion = gradleWrapperVersion -} +tasks.withType(GroovyCompile) { + configure(groovyOptions) { + forkOptions.jvmArgs = ['-Xmx1024m'] + } +} +// enable if you wish to package this plugin as a standalone application +bootJar.enabled = false grailsPublish { userOrg = 'kefirsf' license { @@ -83,6 +112,11 @@ grailsPublish { 'micke-a':"Mikael Andersson", pgdoval:"Pablo González Doval", Uniqen:"Magnus Dalin", - demon101:"Demon" + demon101:"Demon", + matrei:"Mattias Reichel" ] } + +assets { + packagePlugin = true +} diff --git a/gradle.properties b/gradle.properties index 96756c4..421a5ce 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,5 @@ -grailsVersion=3.3.2 -gormVersion=6.1.8.RELEASE -gradleWrapperVersion=3.5.1 +grailsVersion=4.0.6 +gormVersion=7.0.8.RELEASE +org.gradle.daemon=true +org.gradle.parallel=true +org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7fdb65a..4c46317 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Mon Jan 15 10:44:43 YEKT 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip diff --git a/grails-app/conf/application.groovy b/grails-app/conf/application.groovy deleted file mode 100644 index 1544db2..0000000 --- a/grails-app/conf/application.groovy +++ /dev/null @@ -1,36 +0,0 @@ -grails { - profile = 'web-plugin' - codegen { - defaultPackage = 'grails.plugin.asyncmail' - } -} -info { - app { - name = '@info.app.name@' - version = '@info.app.version@' - grailsVersion = '@info.app.grailsVersion@' - } -} -spring { - groovy { - template."check-template-location" = false - } -} - -environments { - test { - hibernate.dialect = 'org.hibernate.dialect.H2Dialect' - dataSource { - pooled = true - lazy = false - jmxExport = true - driverClassName = 'org.h2.Driver' - username = 'sa' - password = '' - dbCreate = 'create-drop' - url = 'jdbc:h2:mem:test;DB_CLOSE_DELAY=-1' - } - quartz.jdbcStore = false - } -} - diff --git a/grails-app/conf/application.yml b/grails-app/conf/application.yml new file mode 100644 index 0000000..7de06ec --- /dev/null +++ b/grails-app/conf/application.yml @@ -0,0 +1,112 @@ +--- +grails: + profile: web-plugin + codegen: + defaultPackage: grails.plugin.asyncmail + gorm: + reactor: + # Whether to translate GORM events into Reactor events + # Disabled by default for performance reasons + events: false +info: + app: + name: '@info.app.name@' + version: '@info.app.version@' + grailsVersion: '@info.app.grailsVersion@' +spring: + jmx: + unique-names: true + main: + banner-mode: "off" + groovy: + template: + check-template-location: false + devtools: + restart: + additional-exclude: + - '*.gsp' + - '**/*.gsp' + - '*.gson' + - '**/*.gson' + - 'logback.groovy' + - '*.properties' +management: + endpoints: + enabled-by-default: false + +--- +grails: + mime: + disable: + accept: + header: + userAgents: + - Gecko + - WebKit + - Presto + - Trident + types: + all: '*/*' + atom: application/atom+xml + css: text/css + csv: text/csv + form: application/x-www-form-urlencoded + html: + - text/html + - application/xhtml+xml + js: text/javascript + json: + - application/json + - text/json + multipartForm: multipart/form-data + pdf: application/pdf + rss: application/rss+xml + text: text/plain + hal: + - application/hal+json + - application/hal+xml + xml: + - text/xml + - application/xml + urlmapping: + cache: + maxsize: 1000 + controllers: + defaultScope: singleton + converters: + encoding: UTF-8 + views: + default: + codec: html + gsp: + encoding: UTF-8 + htmlcodec: xml + codecs: + expression: html + scriptlet: html + taglib: none + staticparts: none +management: + endpoints: + jmx: + unique-names: true + +--- + +environments: + test: + quartz: + jdbcStore: false + hibernate: + cache: + queries: false + use_second_level_cache: false + use_query_cache: false + dataSource: + pooled: true + jmxExport: true + driverClassName: org.h2.Driver + username: sa + password: '' + dbCreate: create-drop + url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE diff --git a/grails-app/conf/plugin.groovy b/grails-app/conf/plugin.groovy index 392a377..26261f6 100644 --- a/grails-app/conf/plugin.groovy +++ b/grails-app/conf/plugin.groovy @@ -7,6 +7,6 @@ asynchronous.mail.send.immediately=true asynchronous.mail.clear.after.sent=false // true, false, 'attachments' asynchronous.mail.disable=false asynchronous.mail.useFlushOnSave=true -asynchronous.mail.persistence.provider='hibernate4' // Possible values are 'hibernate', 'hibernate4', 'mongodb' +asynchronous.mail.persistence.provider='hibernate5' // Possible values are 'hibernate', 'hibernate4', 'hibernate5', 'mongodb' asynchronous.mail.newSessionOnImmediateSend=false asynchronous.mail.taskPoolSize=1 \ No newline at end of file diff --git a/grails-app/init/grails/plugin/asyncmail/Application.groovy b/grails-app/init/grails/plugin/asyncmail/Application.groovy index e739836..e2a84d7 100644 --- a/grails-app/init/grails/plugin/asyncmail/Application.groovy +++ b/grails-app/init/grails/plugin/asyncmail/Application.groovy @@ -1,8 +1,10 @@ package grails.plugin.asyncmail -import grails.boot.GrailsApp +import grails.boot.* import grails.boot.config.GrailsAutoConfiguration +import grails.plugins.metadata.* +@PluginSource class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) diff --git a/grails-app/services/grails/plugin/asyncmail/AsynchronousMailPersistenceService.groovy b/grails-app/services/grails/plugin/asyncmail/AsynchronousMailPersistenceService.groovy index 9e77512..8ac9770 100644 --- a/grails-app/services/grails/plugin/asyncmail/AsynchronousMailPersistenceService.groovy +++ b/grails-app/services/grails/plugin/asyncmail/AsynchronousMailPersistenceService.groovy @@ -1,10 +1,12 @@ package grails.plugin.asyncmail +import grails.gorm.transactions.Transactional import grails.plugin.asyncmail.enums.MessageStatus import groovy.transform.CompileStatic import groovy.util.logging.Slf4j @Slf4j +@Transactional class AsynchronousMailPersistenceService { AsynchronousMailConfigService asynchronousMailConfigService diff --git a/grails-app/services/grails/plugin/asyncmail/AsynchronousMailProcessService.groovy b/grails-app/services/grails/plugin/asyncmail/AsynchronousMailProcessService.groovy index ea728bf..2e5e10c 100644 --- a/grails-app/services/grails/plugin/asyncmail/AsynchronousMailProcessService.groovy +++ b/grails-app/services/grails/plugin/asyncmail/AsynchronousMailProcessService.groovy @@ -1,6 +1,7 @@ package grails.plugin.asyncmail import grails.async.Promises +import grails.gorm.transactions.Transactional import grails.plugin.asyncmail.enums.MessageStatus import groovy.transform.CompileStatic import groovy.util.logging.Slf4j @@ -14,6 +15,7 @@ import static grails.async.Promises.task @Slf4j @CompileStatic +@Transactional class AsynchronousMailProcessService { AsynchronousMailPersistenceService asynchronousMailPersistenceService diff --git a/src/integration-test/groovy/grails/plugin/asyncmail/AsyncMailServiceSpec.groovy b/src/integration-test/groovy/grails/plugin/asyncmail/AsyncMailServiceSpec.groovy index ab832a9..6977fea 100644 --- a/src/integration-test/groovy/grails/plugin/asyncmail/AsyncMailServiceSpec.groovy +++ b/src/integration-test/groovy/grails/plugin/asyncmail/AsyncMailServiceSpec.groovy @@ -1,8 +1,7 @@ package grails.plugin.asyncmail -import grails.test.mixin.integration.Integration import grails.testing.mixin.integration.Integration -import grails.transaction.Rollback +import grails.gorm.transactions.Rollback import spock.lang.Specification import javax.annotation.Resource diff --git a/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailConfigServiceSpec.groovy b/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailConfigServiceSpec.groovy index c73ed64..f89ec69 100644 --- a/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailConfigServiceSpec.groovy +++ b/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailConfigServiceSpec.groovy @@ -11,7 +11,7 @@ class AsynchronousMailConfigServiceSpec extends Specification { AsynchronousMailConfigService asynchronousMailConfigService void "test configuration"() { - expect: "the service returns defult values" + expect: "the service returns default values" asynchronousMailConfigService.defaultAttemptInterval == 300000l asynchronousMailConfigService.defaultMaxAttemptCount == 1 asynchronousMailConfigService.sendRepeatInterval == 60000l @@ -21,7 +21,7 @@ class AsynchronousMailConfigServiceSpec extends Specification { !asynchronousMailConfigService.clearAfterSent !asynchronousMailConfigService.disable asynchronousMailConfigService.useFlushOnSave - asynchronousMailConfigService.persistenceProvider == 'hibernate4' + asynchronousMailConfigService.persistenceProvider == 'hibernate5' !asynchronousMailConfigService.newSessionOnImmediateSend asynchronousMailConfigService.taskPoolSize == 1 !asynchronousMailConfigService.mongo diff --git a/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailPersistenceServiceSpec.groovy b/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailPersistenceServiceSpec.groovy index e681190..7704442 100644 --- a/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailPersistenceServiceSpec.groovy +++ b/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailPersistenceServiceSpec.groovy @@ -1,7 +1,7 @@ package grails.plugin.asyncmail import grails.testing.mixin.integration.Integration -import grails.transaction.Rollback +import grails.gorm.transactions.Rollback import org.springframework.beans.factory.annotation.Autowired import spock.lang.Specification diff --git a/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailProcessServiceIntegrationSpec.groovy b/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailProcessServiceIntegrationSpec.groovy index 6138819..eb152a7 100644 --- a/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailProcessServiceIntegrationSpec.groovy +++ b/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailProcessServiceIntegrationSpec.groovy @@ -4,7 +4,7 @@ import grails.config.Config import grails.core.support.GrailsConfigurationAware import grails.plugin.asyncmail.enums.MessageStatus import grails.testing.mixin.integration.Integration -import grails.transaction.Rollback +import grails.gorm.transactions.Rollback import org.springframework.transaction.TransactionDefinition import spock.lang.Specification import spock.lang.Unroll diff --git a/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailServiceSpec.groovy b/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailServiceSpec.groovy index 3fe72b2..9fb924f 100644 --- a/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailServiceSpec.groovy +++ b/src/integration-test/groovy/grails/plugin/asyncmail/AsynchronousMailServiceSpec.groovy @@ -1,7 +1,7 @@ package grails.plugin.asyncmail import grails.testing.mixin.integration.Integration -import grails.transaction.Rollback +import grails.gorm.transactions.Rollback import org.springframework.beans.factory.annotation.Autowired import spock.lang.Specification diff --git a/src/main/groovy/grails/plugin/asyncmail/AsynchronousMailGrailsPlugin.groovy b/src/main/groovy/grails/plugin/asyncmail/AsynchronousMailGrailsPlugin.groovy index 8434a2a..f88b695 100644 --- a/src/main/groovy/grails/plugin/asyncmail/AsynchronousMailGrailsPlugin.groovy +++ b/src/main/groovy/grails/plugin/asyncmail/AsynchronousMailGrailsPlugin.groovy @@ -10,7 +10,7 @@ import org.quartz.TriggerKey @Slf4j class AsynchronousMailGrailsPlugin extends Plugin { - def grailsVersion = "3.3.0 > *" + def grailsVersion = "4.0.0 > *" def loadAfter = ['mail', 'quartz', 'hibernate', 'hibernate3', 'hibernate4', 'hibernate5', 'mongodb'] Closure doWithSpring() { { -> From f4acfdd0ef86c3955e865f961bb072486612b37f Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Mon, 25 Jan 2021 16:01:27 +0100 Subject: [PATCH 2/3] Updated README --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8b31c28..0e5aeb8 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,12 @@ database with Grails domain classes and sends them by a scheduled Quartz job. Ma the `sendAsynchronousMail` (or `sendMail`) method returning instantly, is not waiting for the mail to be actually sent. If the SMTP server isn't available, or other errors occur, the plugin can be set to retry later. -The plugin depends on the [quartz](https://grails.org/plugins.html#plugin/quartz) and the [mail](https://grails.org/plugins.html#plugin/mail) plugins. You also need a persistence provider plugin, [hibernate4](https://grails.org/plugins.html#plugin/hibernate4) and [mongodb](https://grails.org/plugins.html#plugin/mongodb) are supported. +The plugin depends on the [quartz](https://grails.org/plugins.html#plugin/quartz) and the [mail](https://grails.org/plugins.html#plugin/mail) plugins. You also need a persistence provider plugin, [hibernate5](https://plugins.grails.org/plugin/grails/hibernate5) and [mongodb](https://plugins.grails.org/plugin/grails/mongodb) are supported. Links ----- -* The plugin page: +* The plugin page: * The VCS repository (GitHub): * The issue tracker (GitHub): * The repository package (BinTray): @@ -25,14 +25,17 @@ Links Installation ------------ -To install just add the plugin to the plugins block of `build.gradle`. For Grails 3.3.x +To install just add the plugin to the plugins block of `build.gradle`. For Grails 4.0.x +```groovy +compile "org.grails.plugins:asynchronous-mail:3.0.0" +``` +For Grails 3.3.x ```groovy compile "org.grails.plugins:asynchronous-mail:2.0.2" ``` For Grails 3.2.11 and earlier - ```groovy compile "org.grails.plugins:asynchronous-mail:2.0.2-3.2.x" ``` @@ -74,12 +77,12 @@ If you want to change this options just add options which you want to change to |`asynchronous.mail.newSessionOnImmediateSend`|`false`|If `true` the new DB session will be created for storing a message into DB. It's needed if you want to send an email in case of error when all changes in DB are rolled back.| |`asynchronous.mail.taskPoolSize`|`1`|Max count of parallel tasks for sending messages concurrently.| -Configure the [mail](https://grails.org/plugins.html#plugin/mail) plugin. The Asynchronous Mail plugin uses the [mail](https://grails.org/plugins.html#plugin/mail) plugin for sending messages to the SMTP server. +Configure the [mail](https://plugins.grails.org/plugin/grails/mail) plugin. The Asynchronous Mail plugin uses the [mail](https://plugins.grails.org/plugin/grails/mail) plugin for sending messages to the SMTP server. Usage ----- -If you already used the [mail](https://grails.org/plugins.html#plugin/mail) plugin, you have to import class `AsynchronousMailService` to your class. +If you already used the [mail](https://plugins.grails.org/plugin/grails/mail) plugin, you have to import class `AsynchronousMailService` to your class. ```groovy import grails.plugin.asyncmail.AsynchronousMailService From 839c94858e3a62312350b0c408c7eea22e82b0eb Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Mon, 25 Jan 2021 16:01:27 +0100 Subject: [PATCH 3/3] Updated README --- README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8b31c28..ab58cec 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,12 @@ database with Grails domain classes and sends them by a scheduled Quartz job. Ma the `sendAsynchronousMail` (or `sendMail`) method returning instantly, is not waiting for the mail to be actually sent. If the SMTP server isn't available, or other errors occur, the plugin can be set to retry later. -The plugin depends on the [quartz](https://grails.org/plugins.html#plugin/quartz) and the [mail](https://grails.org/plugins.html#plugin/mail) plugins. You also need a persistence provider plugin, [hibernate4](https://grails.org/plugins.html#plugin/hibernate4) and [mongodb](https://grails.org/plugins.html#plugin/mongodb) are supported. +The plugin depends on the [quartz](https://grails.org/plugins.html#plugin/quartz) and the [mail](https://grails.org/plugins.html#plugin/mail) plugins. You also need a persistence provider plugin, [hibernate5](https://plugins.grails.org/plugin/grails/hibernate5) and [mongodb](https://plugins.grails.org/plugin/grails/mongodb) are supported. Links ----- -* The plugin page: +* The plugin page: * The VCS repository (GitHub): * The issue tracker (GitHub): * The repository package (BinTray): @@ -25,14 +25,17 @@ Links Installation ------------ -To install just add the plugin to the plugins block of `build.gradle`. For Grails 3.3.x +To install just add the plugin to the plugins block of `build.gradle`. For Grails 4.0.x +```groovy +compile "org.grails.plugins:asynchronous-mail:3.0.0" +``` +For Grails 3.3.x ```groovy compile "org.grails.plugins:asynchronous-mail:2.0.2" ``` For Grails 3.2.11 and earlier - ```groovy compile "org.grails.plugins:asynchronous-mail:2.0.2-3.2.x" ``` @@ -52,7 +55,7 @@ asynchronous.mail.send.immediately=true asynchronous.mail.clear.after.sent=false asynchronous.mail.disable=false asynchronous.mail.useFlushOnSave=true -asynchronous.mail.persistence.provider='hibernate4' // Possible values are 'hibernate', 'hibernate4', 'mongodb' +asynchronous.mail.persistence.provider='hibernate5' // Possible values are 'hibernate', 'hibernate4', 'hibernate5', 'mongodb' asynchronous.mail.newSessionOnImmediateSend=false asynchronous.mail.taskPoolSize=1 ``` @@ -70,16 +73,16 @@ If you want to change this options just add options which you want to change to |`asynchronous.mail.clear.after.sent`|`false`|If `true` then all messages will be deleted after sent. If `attachments` then attachments of all messages will be deleted.| |`asynchronous.mail.disable`|`false`|If true then jobs aren't started.| |`asynchronous.mail.useFlushOnSave`|`true`|By default the plugin flushes all changes to the DB on every step of the sending process for prevent resending but it makes overhead. So you can set this property to `false` and it will have better performance but will not have guarantee of prevention of resending.| -|`asynchronous.mail.persistence.provider`|`hibernate4`|The persistence provider. Possible values are `hibernate`, `hibernate3`, `hibernate4`, `hibernate5`, `mongodb`.| +|`asynchronous.mail.persistence.provider`|`hibernate5`|The persistence provider. Possible values are `hibernate`, `hibernate3`, `hibernate4`, `hibernate5`, `mongodb`.| |`asynchronous.mail.newSessionOnImmediateSend`|`false`|If `true` the new DB session will be created for storing a message into DB. It's needed if you want to send an email in case of error when all changes in DB are rolled back.| |`asynchronous.mail.taskPoolSize`|`1`|Max count of parallel tasks for sending messages concurrently.| -Configure the [mail](https://grails.org/plugins.html#plugin/mail) plugin. The Asynchronous Mail plugin uses the [mail](https://grails.org/plugins.html#plugin/mail) plugin for sending messages to the SMTP server. +Configure the [mail](https://plugins.grails.org/plugin/grails/mail) plugin. The Asynchronous Mail plugin uses the [mail](https://plugins.grails.org/plugin/grails/mail) plugin for sending messages to the SMTP server. Usage ----- -If you already used the [mail](https://grails.org/plugins.html#plugin/mail) plugin, you have to import class `AsynchronousMailService` to your class. +If you already used the [mail](https://plugins.grails.org/plugin/grails/mail) plugin, you have to import class `AsynchronousMailService` to your class. ```groovy import grails.plugin.asyncmail.AsynchronousMailService