DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Join us tomorrow at 1 PM EST: "3-Step Approach to Comprehensive Runtime Application Security"
Save your seat
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Pub/Sub Using vFabric, Spring Integration, and Gemfire

Pub/Sub Using vFabric, Spring Integration, and Gemfire

Krishna Prasad user avatar by
Krishna Prasad
·
Feb. 13, 13 · Interview
Like (0)
Save
Tweet
Share
3.43K Views

Join the DZone community and get the full member experience.

Join For Free
as part of vfabric you get springsource tool suite (sts) , vfabric tc server , spring amqp to incorporate vfabric rabbitmq messaging, and spring data project that simplifies access to vfabric gemfire , sqlfire and postgres.

in the next few blogs, i will be discussing how each pieces tie in together. in this blog i will be demonstrating how spring integration and vfabric gemfire participate in a typical publisher/ subscriber eip pattern, where in data is picked from source system and delivered to 1 or many target systems.

for people who are in hurry, here is the code and the steps to execute .

details: publisher, subscriber using vfabric spring integration, gemfire

this demo is the continuation of my earlier blog on claimcheck pattern . i will implement an end to end flow as below

publisher subscriber esb using spring integration, gemfire and activemq

publisher subscriber esb using spring integration, gemfire and activemq

for demo purpose, on the publisher side, the message that comes in from claimcheck output is directly bridged to the jms outbound channel adapter . but in an enterprise application, in reality there can be a spring integration flow which can do an entire workflow/ transformation/ mapping, before it puts the message onto the topic.

again for demo purpose, on the subscriber side, i just directly took the payload output from claimcheck and passed to a console based service activator. but in an enterprise application, it can be sending this to a target system.

the technology stack i used for this is, hsqldb database, activemq jms along with vfabric tc server and vfabric gemfire.

on the publisher side, the jdbc listener is configured in the spring integration as below,

<int-jdbc:inbound-channel-adapter
query="select * from notification where status=2" channel="jdbc.inbound"
data-source="datasource" update="update notification set status=10 where id in (:id)">
<int:poller fixed-rate="1000" />
</int-jdbc:inbound-channel-adapter>

and you bridge this to the claimcheck channel as below,

<!-- for convenience sake we are bridging the jdbc to directly claimcheck in reality we will be going thru a si flow
<int:bridge input-channel="jdbc.inbound"
output-channel="common.claimcheck.in.inputchannel" />

<!-- bridge the claimcheck output directly to jms -->
<int:bridge input-channel="common.claimcheck.in.outputchannel"
output-channel="jms-channel.out" />

on the subscriber side, the payload is pushed to the vfabric gemfire and a guid is created on the vfabric gemfire side and it is pushed to the topic. the subscriber component picks up the payload and prints to the console. this blog explains this more in detail.

conclusion

vfabric infrastructure provides a good support for developing integration components by the way of sts ide , vfabric tc server , vfabric gemfire . i have clearly demonstrated how you can build a publisher/subscriber components which can integrate a source system to target system.

i hope this blog helped you.

Spring Integration Integration Spring Framework

Published at DZone with permission of Krishna Prasad, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • ChatGPT Prompts for Agile Practitioners
  • Kotlin Is More Fun Than Java And This Is a Big Deal
  • The Quest for REST
  • Java Development Trends 2023

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: