Skip to content

Instantly share code, notes, and snippets.

Evgeny Smirnov illerax

  • Belarus
Block or report user

Report or block illerax

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View RandomInit.groovy
package com.illerax.randominit
import org.codehaus.groovy.transform.GroovyASTTransformationClass
import java.lang.annotation.ElementType
import java.lang.annotation.Retention
import java.lang.annotation.RetentionPolicy
import java.lang.annotation.Target
@Target([ElementType.LOCAL_VARIABLE])
View RandomInitTransformation.groovy
package com.illerax.randominit
import org.codehaus.groovy.ast.ASTNode
import org.codehaus.groovy.ast.expr.ConstantExpression
import org.codehaus.groovy.control.CompilePhase
import org.codehaus.groovy.control.SourceUnit
import org.codehaus.groovy.transform.ASTTransformation
import org.codehaus.groovy.transform.GroovyASTTransformation
/**
View RandomInitTest.groovy
package test
import com.illerax.randominit.RandomInit
class RandomInitTest extends GroovyTestCase {
void testRandomInitAnnotation() {
@RandomInit def exp
assert exp == null
@illerax
illerax / application.yml
Created Nov 22, 2017
Grails Amazon SQS Example application config
View application.yml
amazon:
key: IAM-user-key
secret: IAM-user-secret
sqs:
queue: SQS-queue-name
@illerax
illerax / build.gradle
Created Nov 22, 2017
Grails Amazon SQS Example build config
View build.gradle
//AWS SDK for Java
compile 'com.amazonaws:aws-java-sdk:1.11.228'
//Spring JMS implementation
compile 'org.springframework:spring-jms'
//Amazon SQS Client Libraries for JMS
compile 'com.amazonaws:amazon-sqs-java-messaging-lib:1.0.4'
@illerax
illerax / JmsConfig.groovy
Created Nov 22, 2017
Grails Amazon SQS Example JMS configuration
View JmsConfig.groovy
package grails.aws.sqs.example.config
import com.amazon.sqs.javamessaging.ProviderConfiguration
import com.amazon.sqs.javamessaging.SQSConnectionFactory
import com.amazonaws.auth.AWSCredentials
import com.amazonaws.auth.AWSStaticCredentialsProvider
import com.amazonaws.regions.Regions
import com.amazonaws.services.sqs.AmazonSQSClientBuilder
import grails.util.Holders
import org.springframework.context.annotation.Bean
@illerax
illerax / Application.groovy
Created Nov 22, 2017
Grails Amazon SQS Example component scan
View Application.groovy
@ComponentScan("grails.aws.sqs.example.config")
class Application extends GrailsAutoConfiguration {
static void main(String[] args) {
GrailsApp.run(Application, args)
}
}
@illerax
illerax / AmazonSQSService.groovy
Created Nov 22, 2017
Grails Amazon SQS Example producer
View AmazonSQSService.groovy
def defaultJmsTemplate
/*
* Send message to Amazon SQS Queue
* */
void sendMessage(String queueName, String payload) {
log.debug "Send message to SQS, queue:$queueName, message:$payload"
defaultJmsTemplate.convertAndSend(queueName, payload)
}
@illerax
illerax / AmazonSQSService.groovy
Created Nov 22, 2017
Grails Amazon SQS Example consumer
View AmazonSQSService.groovy
/*
* Recieve message from Amazon SQS Queue
* */
@JmsListener(destination = '${amazon.sqs.queue}')
void listenSyncManager(String requestString) {
log.info "Received from SQS: $requestString"
}
You can’t perform that action at this time.