kandi background
Explore Kits

gs-messaging-jms | JMS : : Learn how to publish and subscribe to messages | Pub Sub library

 by   spring-guides Java Version: Current License: Apache-2.0

 by   spring-guides Java Version: Current License: Apache-2.0

Download this library from

kandi X-RAY | gs-messaging-jms Summary

gs-messaging-jms is a Java library typically used in Messaging, Pub Sub, Spring, Kafka applications. gs-messaging-jms has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. However gs-messaging-jms build file is not available. You can download it from GitHub.
This guide walks you through the process of publishing and subscribing to messages using a JMS broker.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • gs-messaging-jms has a low active ecosystem.
  • It has 60 star(s) with 118 fork(s). There are 27 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 6 open issues and 5 have been closed. On average issues are closed in 19 days. There are 2 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of gs-messaging-jms is current.
gs-messaging-jms Support
Best in #Pub Sub
Average in #Pub Sub
gs-messaging-jms Support
Best in #Pub Sub
Average in #Pub Sub

quality kandi Quality

  • gs-messaging-jms has 0 bugs and 0 code smells.
gs-messaging-jms Quality
Best in #Pub Sub
Average in #Pub Sub
gs-messaging-jms Quality
Best in #Pub Sub
Average in #Pub Sub

securitySecurity

  • gs-messaging-jms has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • gs-messaging-jms code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
gs-messaging-jms Security
Best in #Pub Sub
Average in #Pub Sub
gs-messaging-jms Security
Best in #Pub Sub
Average in #Pub Sub

license License

  • gs-messaging-jms is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
gs-messaging-jms License
Best in #Pub Sub
Average in #Pub Sub
gs-messaging-jms License
Best in #Pub Sub
Average in #Pub Sub

buildReuse

  • gs-messaging-jms releases are not available. You will need to build from source code and install.
  • gs-messaging-jms has no build file. You will be need to create the build yourself to build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • It has 151 lines of code, 11 functions and 5 files.
  • It has low code complexity. Code complexity directly impacts maintainability of the code.
gs-messaging-jms Reuse
Best in #Pub Sub
Average in #Pub Sub
gs-messaging-jms Reuse
Best in #Pub Sub
Average in #Pub Sub
Top functions reviewed by kandi - BETA

kandi has reviewed gs-messaging-jms and discovered the below as its top functions. This is intended to give you an instant insight into gs-messaging-jms implemented functionality, and help decide if they suit your requirements.

  • Entry point for the JMS application .
    • Bean factory beanFactory .
      • Handles JSON converter .
        • Returns a string representation of the email .
          • Received a message .
            • Gets the email address .
              • Sets the email address .
                • Gets the body of the alert .

                  Get all kandi verified functions for this library.

                  Get all kandi verified functions for this library.

                  gs-messaging-jms Key Features

                  What You Will build

                  What You need

                  Starting with Spring Initializr Manual Initialization (optional)

                  Create a Message Receiver

                  Send and receive JMS messages with Spring

                  Summary

                  gs-messaging-jms Examples and Code Snippets

                  See all related Code Snippets

                  Starting with Spring Initializr

                  copy iconCopydownload iconDownload
                  link:complete/pom.xml[]

                  Create a Message Receiver

                  copy iconCopydownload iconDownload
                  link:complete/src/main/java/hello/Email.java[]

                  Send and receive JMS messages with Spring

                  copy iconCopydownload iconDownload
                  link:complete/src/main/java/hello/Application.java[]

                  SpringBoot application publish and read from ActiveMQ topic

                  copy iconCopydownload iconDownload
                  @Bean
                  public JmsListenerContainerFactory<?> topicListenerFactory(ConnectionFactory connectionFactory,
                                                                             DefaultJmsListenerContainerFactoryConfigurer configurer) {
                      DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
                      // the configurer will use PubSubDomain from application.properties if defined or false if not
                      //so setting it on the factory level need to be set after this
                      configurer.configure(factory, connectionFactory);
                      factory.setPubSubDomain(true);
                      return factory;
                  }
                  
                      jmsTemplate.convertAndSend( new ActiveMQTopic(MAILBOX_TOPIC), new Email("info@example.com", "Hello"));
                  
                  @Bean
                  public JmsListenerContainerFactory<?> topicListenerFactory(ConnectionFactory connectionFactory,
                                                                             DefaultJmsListenerContainerFactoryConfigurer configurer) {
                      DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
                      // the configurer will use PubSubDomain from application.properties if defined or false if not
                      //so setting it on the factory level need to be set after this
                      configurer.configure(factory, connectionFactory);
                      factory.setPubSubDomain(true);
                      return factory;
                  }
                  
                      jmsTemplate.convertAndSend( new ActiveMQTopic(MAILBOX_TOPIC), new Email("info@example.com", "Hello"));
                  

                  See all related Code Snippets

                  Community Discussions

                  Trending Discussions on gs-messaging-jms
                  • SpringBoot application publish and read from ActiveMQ topic
                  Trending Discussions on gs-messaging-jms

                  QUESTION

                  SpringBoot application publish and read from ActiveMQ topic

                  Asked 2017-Jan-13 at 11:21

                  I have two receivers that should read from a topic. But only one random receiver gets message like it's actually reading from a queue not a topic. I've read this answer but it doesn't seem to be working. Here is my code.

                  Application.java:

                  package hello;
                  
                  import org.springframework.boot.SpringApplication;
                  import org.springframework.boot.autoconfigure.SpringBootApplication;
                  import org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer;
                  import org.springframework.context.ConfigurableApplicationContext;
                  import org.springframework.context.annotation.Bean;
                  import org.springframework.jms.annotation.EnableJms;
                  import org.springframework.jms.config.DefaultJmsListenerContainerFactory;
                  import org.springframework.jms.config.JmsListenerContainerFactory;
                  import org.springframework.jms.core.JmsTemplate;
                  import org.springframework.jms.support.converter.MappingJackson2MessageConverter;
                  import org.springframework.jms.support.converter.MessageConverter;
                  import org.springframework.jms.support.converter.MessageType;
                  
                  import javax.jms.ConnectionFactory;
                  
                  @SpringBootApplication
                  @EnableJms
                  public class Application {
                      public static final String MAILBOX_TOPIC = "inbox.topic";
                  
                      public static void main(String[] args) {
                          // Launch the application
                          ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);
                  
                          JmsTemplate jmsTemplate = context.getBean(JmsTemplate.class);
                  
                          // Send a message with a POJO - the template reuse the message converter
                          System.out.println("Sending an email message.");
                          jmsTemplate.convertAndSend(MAILBOX_TOPIC, new Email("info@example.com", "Hello"));
                      }
                  
                      @Bean
                      public JmsListenerContainerFactory<?> topicListenerFactory(ConnectionFactory connectionFactory,
                                                                                 DefaultJmsListenerContainerFactoryConfigurer configurer) {
                          DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
                          factory.setPubSubDomain(true);
                          configurer.configure(factory, connectionFactory);
                          return factory;
                      }
                  
                      @Bean // Serialize message content to json using TextMessage
                      public MessageConverter jacksonJmsMessageConverter() {
                          MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
                          converter.setTargetType(MessageType.TEXT);
                          converter.setTypeIdPropertyName("_type");
                          return converter;
                      }
                  }
                  

                  FirstReceiver.java:

                  package hello;
                  
                  import org.springframework.jms.annotation.JmsListener;
                  import org.springframework.stereotype.Component;
                  import static hello.Application.MAILBOX_TOPIC;
                  
                  @Component
                  public class FirstReceiver {
                  
                      @JmsListener(destination = MAILBOX_TOPIC, containerFactory = "topicListenerFactory")
                      public void receiveMessage(Email email) {
                          System.out.println("FirstReceiver <" + email + ">");
                      }
                  
                  }
                  

                  SecondReceiver.java:

                  package hello;
                  
                  import org.springframework.jms.annotation.JmsListener;
                  import org.springframework.stereotype.Component;
                  
                  import static hello.Application.MAILBOX_TOPIC;
                  
                  @Component
                  public class SecondReceiver {
                      @JmsListener(destination = MAILBOX_TOPIC, containerFactory = "topicListenerFactory")
                      public void receiveMessage(Email email) {
                          System.out.println("SecondReceiver <" + email + ">");
                      }
                  
                  }
                  

                  Email.java:

                  package hello;
                  
                  public class Email {
                  
                      private String to;
                      private String body;
                  
                      public Email() {
                      }
                  
                      public Email(String to, String body) {
                          this.to = to;
                          this.body = body;
                      }
                  
                      public String getTo() {
                          return to;
                      }
                  
                      public void setTo(String to) {
                          this.to = to;
                      }
                  
                      public String getBody() {
                          return body;
                      }
                  
                      public void setBody(String body) {
                          this.body = body;
                      }
                  
                      @Override
                      public String toString() {
                          return String.format("Email{to=%s, body=%s}", getTo(), getBody());
                      }
                  
                  }
                  

                  pom.xml:

                  <?xml version="1.0" encoding="UTF-8"?>
                  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
                      <modelVersion>4.0.0</modelVersion>
                  
                      <groupId>org.springframework</groupId>
                      <artifactId>gs-messaging-jms</artifactId>
                      <version>0.1.0</version>
                  
                      <parent>
                          <groupId>org.springframework.boot</groupId>
                          <artifactId>spring-boot-starter-parent</artifactId>
                          <version>1.4.3.RELEASE</version>
                      </parent>
                  
                      <properties>
                          <java.version>1.8</java.version>
                      </properties>
                  
                      <dependencies>
                          <dependency>
                              <groupId>org.springframework.boot</groupId>
                              <artifactId>spring-boot-starter-activemq</artifactId>
                          </dependency>
                          <dependency>
                              <groupId>org.apache.activemq</groupId>
                              <artifactId>activemq-broker</artifactId>
                          </dependency>
                  
                          <dependency>
                              <groupId>com.fasterxml.jackson.core</groupId>
                              <artifactId>jackson-databind</artifactId>
                          </dependency>
                      </dependencies>
                  
                      <build>
                          <plugins>
                              <plugin>
                                  <groupId>org.springframework.boot</groupId>
                                  <artifactId>spring-boot-maven-plugin</artifactId>
                              </plugin>
                          </plugins>
                      </build>
                  
                  </project>
                  

                  Please assist me.

                  ANSWER

                  Answered 2017-Jan-13 at 11:21

                  add spring.jms.pub-sub-domain=true to application.properties

                  UPDATE:

                  you need to change 2 things :

                  1.

                  @Bean
                  public JmsListenerContainerFactory<?> topicListenerFactory(ConnectionFactory connectionFactory,
                                                                             DefaultJmsListenerContainerFactoryConfigurer configurer) {
                      DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
                      // the configurer will use PubSubDomain from application.properties if defined or false if not
                      //so setting it on the factory level need to be set after this
                      configurer.configure(factory, connectionFactory);
                      factory.setPubSubDomain(true);
                      return factory;
                  }
                  

                  2.

                      jmsTemplate.convertAndSend( new ActiveMQTopic(MAILBOX_TOPIC), new Email("info@example.com", "Hello"));
                  

                  or inject this bean

                  Source https://stackoverflow.com/questions/41630436

                  Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                  Vulnerabilities

                  No vulnerabilities reported

                  Install gs-messaging-jms

                  You can download it from GitHub.
                  You can use gs-messaging-jms like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the gs-messaging-jms component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

                  Support

                  For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

                  DOWNLOAD this Library from

                  Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                  over 430 million Knowledge Items
                  Find more libraries
                  Reuse Solution Kits and Libraries Curated by Popular Use Cases
                  Explore Kits

                  Save this library and start creating your kit

                  Explore Related Topics

                  Share this Page

                  share link
                  Consider Popular Pub Sub Libraries
                  Try Top Libraries by spring-guides
                  Compare Pub Sub Libraries with Highest Support
                  Compare Pub Sub Libraries with Highest Quality
                  Compare Pub Sub Libraries with Highest Security
                  Compare Pub Sub Libraries with Permissive License
                  Compare Pub Sub Libraries with Highest Reuse
                  Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                  over 430 million Knowledge Items
                  Find more libraries
                  Reuse Solution Kits and Libraries Curated by Popular Use Cases
                  Explore Kits

                  Save this library and start creating your kit

                  • © 2022 Open Weaver Inc.