Giter VIP home page Giter VIP logo

spring-amqp's Introduction

Spring AMQP Build Status Revved up by Develocity

This project provides support for using Spring and Java with AMQP 0.9.1, and in particular RabbitMQ.

Code of Conduct

Please see our Code of conduct.

Reporting Security Vulnerabilities

Please see our Security policy.

Checking out and Building

To check out the project from GitHub and build from source using Gradle, do the following:

git clone git://github.com/SpringSource/spring-amqp.git
cd spring-amqp
./gradlew build

If you encounter out of memory errors during the build, increase available heap and permgen for Gradle:

GRADLE_OPTS='-XX:MaxPermSize=1024m -Xmx1024m'

To build and install jars into your local Maven cache:

./gradlew install

To build api Javadoc (results will be in build/api):

./gradlew api

To build reference documentation (results will be in build/reference):

./gradlew reference

To build complete distribution including -dist, -docs, and -schema zip files (results will be in build/distributions)

./gradlew dist

To analyze and gather metrics using Sonar:

./gradlew clean build sonar

(Please make sure that you have Sonar running, e.g. on localhost port 9000)

Using Eclipse

To generate Eclipse metadata (.classpath and .project files), do the following:

./gradlew eclipse

Once complete, you may then import the projects into Eclipse as usual:

File -> Import -> Existing projects into workspace

Browse to the 'spring-amqp' root directory. All projects should import free of errors.

Using Spring Tools

Using the STS Gradle Support, you can directly import Gradle projects, without having to generate Eclipse metadata first. Please see the Spring Tools Home Page.

  1. Select File -> Import -> Existing Gradle Project
  2. Browse to the Spring AMQP Root Folder
  3. Click on Finish

Using IntelliJ IDEA

To generate IDEA metadata (.iml and .ipr files), do the following:

./gradlew idea

Changelog

Lists of issues addressed per release can be found in Github.

Additional Resources

Contributing to Spring AMQP

Here are some ways for you to get involved in the community:

  • Get involved with the Spring community on Stack Overflow by responding to questions and joining the debate.

  • Create Github issues for bugs and new features and comment and vote on the ones that you are interested in.

  • Github is for social coding: if you want to write code, we encourage contributions through pull requests from forks of this repository. If you want to contribute code this way, please reference the specific Github issue you are addressing.

Before we accept a non-trivial patch or pull request we will need you to sign the contributor's agreement. Signing the contributor's agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and given the ability to merge pull requests.

Code Conventions and Housekeeping

None of these is essential for a pull request, but they will all help. They can also be added after the original pull request but before a merge.

  • Use the Spring Framework code format conventions (import eclipse-code-formatter.xml from the root of the project if you are using Eclipse).
  • Make sure all new .java files to have a simple Javadoc class comment with at least an @author tag identifying you, and preferably at least a paragraph on what the class is for.
  • Add the ASF license header comment to all new .java files (copy from existing files in the project)
  • Add yourself as an @author to the .java files that you modify substantially (more than cosmetic changes).
  • Add some Javadocs and, if you change the namespace, some XSD doc elements.
  • A few unit tests would help a lot as well - someone has to do it.
  • If no-one else is using your branch, please rebase it against the current main (or other target branch in the main project).

License

Spring AMQP is released under the terms of the Apache Software License Version 2.0 (see LICENSE.txt).

spring-amqp's People

Contributors

acogoluegnes avatar artembilan avatar bjmi avatar cbeams avatar cppwfs avatar dependabot[bot] avatar dreis2211 avatar dsyer avatar garyrussell avatar ghillert avatar gonmmarques avatar jamescarr avatar java4ye avatar jbrisbin avatar leonardoferreiraa avatar markfisher avatar mhewedy avatar neetkee avatar nristock avatar olegz avatar panchenko avatar rwanderc avatar ryl avatar snicoll avatar spring-builds avatar spring-operator avatar tbcs avatar wilkinsona avatar yannbolliger avatar zysaaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-amqp's Issues

remove "default" from template property names for exchange, queue, and routing-key [AMQP-9]

Mark Fisher opened AMQP-9 and commented

We should clarify in the javadoc for methods that accept "exchangeName" or "queueName" that those override the corresponding properties of the template itself. This is different terminology than we use in JmsTemplate, etc. where instead we refer to the default properties ("defaultDestination" or "defaultDestinationName"). This apparent break with consistency is justified however since the AMQP specification describes "default exchange" as the no-name exchange that always exist, and that is actually the default exchange property for our template.


No further details from AMQP-9

NullPointerException in Message.toString() method when BasicProperties are sent as null [AMQP-38]

Andrey Paramonov opened AMQP-38 and commented

I send a message using RabbitMQ Java client - com.rabbitmq.client.Channel#basicPublish(String, String, BasicProperties, byte[]) - with null BasicProperties, which seems to be a valid case. I get NPE when I try to print the message within the MessageListener implementation:

java.lang.NullPointerException
	at org.springframework.amqp.core.Message.getBodyContentAsString(Message.java:70)
	at org.springframework.amqp.core.Message.toString(Message.java:56)
	at java.lang.String.valueOf(String.java:2826)
	at java.lang.StringBuilder.append(StringBuilder.java:115)
	at com.ndpar.spring.rabbitmq.MessageHandler.onMessage(MessageHandler.java:14)
	at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:316)
	at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:254)
	at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:230)
	at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:199)
	at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.processMessage(SimpleMessageListenerContainer.java:229)
	at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:288)
	at java.lang.Thread.run(Thread.java:637)

Affects: 1.0.0.M1

implement SingleConnectionFactory [AMQP-2]

Mark Fisher opened AMQP-2 and commented

For the milestone 1 release, the SingleConnectionFactory should be the default implementation of the ConnectionFactory interface.

Although we had originally planned on using the CachingConnectionFactory as the default, further work is necessary to provide a correct and robust implementation that caches Channels. There are many factors to consider in terms of 1) state that is maintained on a Channel corresponding to its use for acknowledgment of received messages, etc. and 2) volatility of the Connection itself due to certain Channel-related errors cascading to Connection-closing situations. We will explore these in more detail for future milestones.


No further details from AMQP-2

Define a MessageFactory for configuration of common "default" MessageProperties values [AMQP-42]

Mark Fisher opened AMQP-42 and commented

This will be used by MessageConverters, RabbitTemplate, etc.

We should follow this fallback logic:

  1. explicit 'messageFactory' property has been set (e.g. on a RabbitTemplate)
  2. lookup by bean name (or possibly a single 'primary' bean even if others)

For #2, RabbitTemplate (and other users) would need to be BeanFactoryAware.

We need to decide what "default" properties make sense (e.g. persistent?)

Internally it might use MessageBuilder (see #1605).


Issue Links:

  • #1605 Provide a MessageBuilder with "fluent API" methods

hostname property is ignored in ConnectionFactory implementations [AMQP-24]

Mark Fisher opened AMQP-24 and commented

We should set the hostname directly on the target ConnectionFactory rather than storing it in an instance variable (it is currently never being used!).

Also, we should replace the constructor that takes both targetConnectionFactory and hostname so that it only takes the targetConnectionFactory. That target should already have its hostname set anyways.

Finally, the getHostName() method can simply return the targetConnectionFactory.getHost() value.


No further details from AMQP-24

Move Exchange, Queue, and Binding declarations into a post-configuration callback [AMQP-12]

Mark Fisher opened AMQP-12 and commented

The base @Configuration classes can define "queue()" and "exchange()" rather than "declareQueue()" and "declareExchange()". The declarations should happen in a callback upon startup so that in case of a fail-fast configuration error, the Exchanges and Queues will not be declared.

The AbstractRabbitConfiguration class can define an inner class (and return it as a bean) that implements ApplicationListener<ContextRefreshedEvent> then grab the Exchange and Queue beans from the ApplicationContext then declare them. The Queues must be declared before the bindings are created.


No further details from AMQP-12

Add AmqpAdmin interface in spring-amqp-core interface with RabbitAdmin implementation in spring-rabbit [AMQP-6]

Mark Fisher opened AMQP-6 and commented

This will require generic return types as opposed to the implementation specific DeclareOk objects.

For example, when declaring a Queue with an explicit name, we can have a void return type (else throw an Exception), and when declaring a Queue with a generated name, we should return a String (the generated name).


This issue is a sub-task of #1569

Provide consistent configuration and usage of vhosts in RabbitBrokerAdmin [AMQP-8]

Mark Fisher opened AMQP-8 and commented

Would be nice to configure RabbitBrokerAdmin using Spring's ConnectionFactory interface. The vhost from Rabbit's connection factory needs to be extracted and passed into the various jinterface API calls.

for example in RabbitBrokerAdmin

public Map<String, Map<String, String>> getQueueInfo() {
// TODO: pass virtual host... currently hardcoded to default ("/").. need to parse off connection string.
return (Map<String, Map<String, String>>) erlangTemplate.executeAndConvertRpc("rabbit_amqqueue", "info_all", "/".getBytes());
}


No further details from AMQP-8

Move the declaration of queues, exchanges, and bindings into AmqpAdmin [AMQP-46]

Mark Fisher opened AMQP-46 and commented

This code is currently in the abstract @Configuration support class.

We should be able to follow the same approach in AmqpAdmin: it can implement SmartLifecycle with autoStartup set to true... and perhaps determined by a boolean flag (which should be 'true' by default), it will declare all Exchange, Queue, and Binding instances that it finds in the context.

This will only work for the case that all these components are being defined within the same virtual host (basically, they are declared on a Channel returned from a Connection returned from the AmqpAdmin ConnectionFactory, so that is the limitation). Using AmqpAdmin directly (and setting the boolean flag to false) is a perfectly valid option for those cases. We might want to explore some other ideas in the future (like nesting the resources within an outer tag that provides the connection-factory to use for that set).


Issue Links:

  • #1595 Add a boolean flag to SimpleMessageListenerContainer for declaring queues upon initialization
    ("supersedes")

remove the 'passive' property on the AMQP Queue object [AMQP-4]

Mark Fisher opened AMQP-4 and commented

This should ideally be handled as a boolean flag on the components that declare Queues. For example, the AmqpTemplate could have a 'shouldCreateQueueIfNotAvailable' flag. Of course, we might come up with a better, more succinct name than that (suggestions?), and/or we might decide to be negative instead of positive, such as 'shouldFailIfQueueDoesNotExist'.

For naming purposes, we should probably compare to some other similar create-if-not-existing scenarios in Spring.


No further details from AMQP-4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.