Announcement Announcement Module
Collapse
No announcement yet.
GemfireMessageStore hardcoded region name Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • GemfireMessageStore hardcoded region name

    GemfireMessageStore uses a hardcode "messageStoreRegion" value for the region name. There doesn't seem to be a way to inject the region name. On line 67 of GemfireMessageStore class, a new RegionFactoryBean is instantiated and "beanName" property is initialized with "messageStoreRegion" string. Without being able to specify a region name for a messageStore, it is not possible to have different parts of the system write to different regions.

    Is the message store region name hardcoded by design ? Is there an alternate way to override the region name, without having to extend GemfireMessageStore class?

    Code:
     	@SuppressWarnings("unchecked")
    	public void afterPropertiesSet() {
    		try {
    			RegionAttributesFactoryBean attributesFactoryBean = new RegionAttributesFactoryBean();
    			attributesFactoryBean.setIgnoreJTA(this.ignoreJta);
    			attributesFactoryBean.afterPropertiesSet();
    			RegionFactoryBean<Object, Object> messageRegionFactoryBean = new RegionFactoryBean<Object, Object>();
    			messageRegionFactoryBean.setBeanName("messageStoreRegion");
    			messageRegionFactoryBean.setAttributes(attributesFactoryBean.getObject());
    			messageRegionFactoryBean.setCache(cache);
    			messageRegionFactoryBean.afterPropertiesSet();
    			this.messageStoreRegion = messageRegionFactoryBean.getObject();
    		}
    		catch (Exception e) {
    			throw new IllegalArgumentException("Failed to initialize Gemfire Region", e);
    		}
    	}

  • #2
    Yes initially we decided to have a dedicated region for MessageStore similar to the way we control the same thing with JdbcMessageStore and other implementations of MS. The motivation is that its really part of an internal infrastructure.

    Having said that we are open to the alternatives. Can you explain your use case in more details? Why do you need to control the MessageStore's region?

    Comment


    • #3
      Oleg.

      I work with Nripesh & we have the need for a few potential message stores within the same application. We have issues where we would like, for example, several aggregators running with their own message stores, while at the same time, we may have one or more queue-backed channels that we need to operate independently.

      Comment


      • #4
        Actually perfect timing as we are on the verge of a next release of SI (hopefully Monday), and can probably swing this one in so you guys can have it. Can you please rais a feature request here: https://jira.springsource.org/browse/INT

        Thanks

        Comment


        • #5
          https://jira.springsource.org/browse/INT-2550

          Comment

          Working...
          X