ngx-message-queue
A message queue library for Angular 2+ application components to communication each other.
ngx-message-queue
library supports message headers and message payload. It also supports message selectors for subscribers to subscribe to only messages with specific message header via msgSelector.
Selectors are a way of attaching a filter to a subscription to perform content based routing. Selectors are typically apply to message headers, If no headers are attached to the message then all the messages will be delivered to subscriber by default. If subscriber is not configuring the msgSelector then all the messages will be delivered to the subscribers i.e. no filters are applied.
Multiple conditions are allowed in the msgSelector.
ngx-message-queue was previously knowns as ng2-message-queue.
Multiple conditions are allowed in the msgSelector.
ngx-message-queue was previously knowns as ng2-message-queue.
Example of a message selectors
LogLevel= fatal
age > 13
age>=13 & gender=M
Filter expression can be grouped using parenthesis
|
Supported Operators
=, !=, >, <, >=, <=, &, |
|
Message header supports only JSON object. Multiple header properties can be posted with single JSON object
Message payload can be of any type (string, integer, object, JSON etc)
Index
- Install
- Usage
- Import into Angular 2+ application (typescript)
- API
- createQueue(name: string): boolean
- deleteQueue(name: string): boolean
- getQueueNames(): string[]
- getSubscribers(): string[]
- publish(name: string, headers: any, message: any, lazy = true): boolean
- subscribe(name: string, msgSelector: string, callback: (any, any) => void, lazy = true): string
- unsubscribe(id: string): boolean
- Example
- License
Install
npm install ngx-message-queue
Usage
Import into Angular 2+ application (typescript)
ngx-message-queue
is implemented as Angular 2+ injectable service name NgxMessageQueue.
For apps using angular version 6+
NgxMessageQueue
is Injectable as root so no additional decalaration is required in any module.
For apps using angular version prior to 6
Add
NgxMessageQueue
into module providers.import { NgxMessageQueue } from 'ngx-message-queue';
@NgModule({
providers: [NgxMessageQueue]
})
Each component to use NgxMessageQueue
import { NgxMessageQueue } from 'ngx-message-queue';
export class MyComponent {
constructor(private messageQueue: NgxMessageQueue) { }
}
API
createQueue(name: string): boolean
createQueue
will create queue name
.
Return
false
if queue name
exist.this.messageQueue.createQueue('myQueue');
deleteQueue(name: string): boolean
deleteQueue
will delete queue name
.
Return
false
if queue name
does not exist.this.messageQueue.deleteQueue('myQueue');
getQueueNames(): string[]
getQueueNames
will return all queue name in string array.let qNames: string[] = this.messageQueue.getQueueNames();
getSubscribers(): string[]
getSubscribers
will return all subscribers id in string array.let ids: string[] = this.messageQueue.getSubscribers();
publish(name: string, headers: any, message: any, lazy = true): boolean
publish
will put message
into queue name
. It will also put headers
into queue if any. headers
are optional but it is best way to process/route/filter the messages quickly without parsing the message payload.
If
lazy = true
(default), queue name
will be created automatically if not exist yet.
Return true if successful.
Return false if any of following is true:
lazy = false
, and queuename
does not exist.name
is undefined.message
is undefined.
// lazy mode
message = 'This is a test message';
this.mq.publish('myQueue', {}, message);
subscribe(name: string, msgSelector: string, callback: (any, any) => void, lazy = true): string
subscribe
will subscribe for the message posted on the queue name
. Whenever queue name
receives a new message, callback
will be invoked. The callback will return both headers and message payload.
Subscribers can
subscribe
to only certain messages within the same queue. Let us say you have multiple subscribers listening for log messages with different logging level (debug, info, warn, fatal etc). If you want to configure high priority subscriber who listens for logs with 'fatal' level then use msgSelector as loglevel=fatal
this.mq.subscribe('myQueue', 'loglevel=fatal', (headers, message) => this.handleMessage(headers, message));
If
lazy = true
(default), queue name
will be created automatically if not exist yet.
Return subscription id if successful.
Return empty string if any of following is true:
lazy = false
, and queuename
does not exist.name
is undefined.callback
is undefined.
Either use Lambda(fat arrow) in typescript to pass in callback or bind
this
to another variable in javascript, else this
scope will be lost.
Lambda(fat arrow)
ngOnInit() {
this.mq.subscribe('testqueue', '', (headers, message) => this.handleMessage(headers, message));
}
handleMessage(headers, message) {
console.log(message);
}
unsubscribe(id: string): boolean
unsubscribe
will cancel subscription using id
.unsubscribe
will return false if id
is undefined or id
is not found in subscription list.id: string;
this.messageQueue.unsubscribe(this.id);
Example
Github: ng2-message-queue-example
nice post thanks
ReplyDeleteappvn app
Splitwise app
IEEE Final Year projects Project Center in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Project Domains for IT It gives you tips and rules that is progressively critical to consider while choosing any final year project point.
DeleteJavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, project projects for cseAngular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
IEEE Final Year projects Project Center in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Project Domains for IT It gives you tips and rules that is progressively critical to consider while choosing any final year project point.
DeleteJavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, project projects for cseAngular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Wow!! Really a nice Article. Thank you so much for your efforts. Definitely, it will be helpful for others. I would like to follow your blog. Share more like this. Thanks Again.
ReplyDeleteiot training in Chennai | Best iot Training Institute in Chennai
very nice article, tks u.
ReplyDeleteThis is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to article very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
ReplyDeleteDedicatedHosting4u.com
Great. It is good to constantly coming up with creative ideas. Provides much needed knowledge. goal oriented blog posts and always tried to find creative ways to meet goals.
ReplyDeleteThanks
Online affiliates
ReplyDeleteYour post is very good. I got to learn a lot from your post. Thank you for sharing your article for us. it is amazing post
what is seo
types of seo
ReplyDeleteThis is a fantastic idea! I like it a lot because it's super easy for the audience to see the value of opting in. wonderful and amazing post very use full your post thanks for sharing your article
Android Application development
Web application
I appreciate your efforts because it conveys the message of what you are trying to say. It's a great skill to make even the person who doesn't know about the subject could able to understand the subject . Your blogs are understandable and also elaborately described. I hope to read more and more interesting articles from your blog. All the best.
ReplyDeleteSoftware testing online training
Software testing certification training
Software testing online course
Software testing training course
Attend The Data Analytics Course From ExcelR. Practical Data Analytics Course Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Analytics Course.
ReplyDeleteExcelR Data Analytics Course
Nice Article and Thank you for sharing the informative informations...!
ReplyDeleteOracle DBA Course in Chennai
oracle dba training institutes in chennai
Pega Training in Chennai
Linux Training in Chennai
Unix Training in Chennai
Advanced Excel Training in Chennai
Placement Training in Chennai
Soft Skills Training in Chennai
JMeter Training in Chennai
Job Openings in Chennai
Oracle DBA Training in Anna Nagar
Attend The PMP Certification From ExcelR. Practical PMP Certification Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The PMP Certification.
ReplyDeleteExcelR PMP Certification
Delhi Agra Jaipur Tour by Bus
ReplyDeleteDelhi to Jaipur Same Day Tour
Delhi One Day Tour Package
Delhi Sightseeing One Day
Delhi Sightseeing Tour by Bus
Delhi Jaipur One Day Tour Package
Haridwar, Rishikesh Tours by Volvo
ReplyDeleteمكافحة حشرات بالخبر افضل شركة مكافحة حشرات بالخبر
مكافحة حشرات بمكة افضل شركة رش حشرات بمكة
مكافحة حشرات بالمدينة المنورة افضل شركة رش حشرات بالمدينة المنورة
مكافحة حشرات بالدمام افضل شركة مكافحة حشرات بالدمام
I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!
ReplyDeletedata science course in mumbai
Nice post. Thanks for sharing! I want people to know just how good this information is in your blog. It’s interesting content and Great work.
ReplyDeletemachine learning courses
data science course in hyderabad
business analytics courses in hyderabad
This is a wonderful article, Given so much info in it, Thanks for sharing. CodeGnan offers courses in new technologies and makes sure students understand the flow of work from each and every perspective in a Real-Time environmen python training in vijayawada. , data scince training in vijayawada . , java training in vijayawada. ,
ReplyDeleteImpressive! I finally found great post here. Nice article on data science . It's really a nice experience to read your post. Thanks for sharing your innovative ideas to our vision.
ReplyDeleteData Science Course
Data Science Course in Marathahalli
wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
ReplyDeleteData science Interview Questions
Data Science Course
I owe my gratitude for giving me an opportunity to read this great blog. This blog has the capacity to grab the readers with its positive force. Web Designing Course Training in Chennai | Web Designing Course Training in annanagar | Web Designing Course Training in omr | Web Designing Course Training in porur | Web Designing Course Training in tambaram | Web Designing Course Training in velachery
ReplyDeleteI really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day!
ReplyDeleteBest Data Science training in Mumbai
Data Science training in Mumbai
I like your article Your take on this topic is well-written and original. I would never have thought of this.
ReplyDeleteSEO Services in Kolkata
Best SEO Services in Kolkata
SEO Company in Kolkata
Best SEO Company in Kolkata
Top SEO Company in Kolkata
Top SEO Services in Kolkata
SEO Services in India
SEO Company in India
Wow! This article is jam-packed full of useful information. The points made here are clear, concise, readable and poignant. I honestly like your writing style.
ReplyDeleteSAP training in Kolkata
Best SAP training in Kolkata
SAP training institute in Kolkata
Reading this article gave me many things to think about. You have some quality information here that any reader would enjoy. I share many of your views in this article.
ReplyDeleteSAP training in Mumbai
Best SAP training in Mumbai
SAP training institute Mumbai
In the event that I needed to give an extraordinary case of top quality substance, this article would be it. It's an elegantly composed critique that holds your advantage.
ReplyDeleteOnline Teaching Platforms
Online Live Class Platform
Online Classroom Platforms
Online Training Platforms
Online Class Software
Virtual Classroom Software
Online Classroom Software
Learning Management System
Learning Management System for Schools
Learning Management System for Colleges
Learning Management System for Universities
Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteCorrelation vs Covariance
Simple linear regression
I am incessantly thought about this, thanks for putting up. website design company nyc
ReplyDeleteFound your weblog and decided to have a study on it, not what I usually do, but this blog is wonderful. Awesome to see a site that’s not spammed, and actually makes some sense. Anyway, great write up. web design manhattan
ReplyDeletevery nice post, i actually love this web site, keep on it branding agencies in san francisco
ReplyDeleteGreat post, you have pointed out some fantastic details , I besides believe this s a very great website. branding firms san francisco
ReplyDeleteI like how this article is written. Your points are sound, original, fresh and interesting. This information has been made so clear there's no way to misunderstand it. Thank you.
ReplyDeleteSAP training in Kolkata
SAP training Kolkata
Best SAP training in Kolkata
SAP course in Kolkata
SAP training institute Kolkata
DeleteGood one. Pros and cons are at once place and easy to pick suitable windows automation tool.
Software Testing Training in Chennai | Software Testing Training in Anna Nagar | Software Testing Training in OMR | Software Testing Training in Porur | Software Testing Training in Tambaram | Software Testing Training in Velachery
Much obliged to you for your meticulousness and extraordinary composing style. Your demonstrable skill appears in your article. I like your intriguing perspectives and value your exceptional thoughts. This is quality.
ReplyDeleteDenial management software
Denials management software
Hospital denial management software
Self Pay Medicaid Insurance Discovery
Uninsured Medicaid Insurance Discovery
Medical billing Denial Management Software
Self Pay to Medicaid
Charity Care Software
Patient Payment Estimator
Underpayment Analyzer
Claim Status
Very interesting blog. Many blogs I see these days do not really provide anything that attracts others, but believe me the way you interact is literally awesome.You can also check my articles as well.
ReplyDeleteData Science In Banglore With Placements
Data Science Course In Bangalore
Data Science Training In Bangalore
Best Data Science Courses In Bangalore
Data Science Institute In Bangalore
Thank you..
Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting. And I found this one pretty fascinating and it should go into my collection. Very good work!
ReplyDeletePMP Certification
PMP Course
PMP Course in Malaysia
PMP Training in Malaysia
PMP Training
It is the intent to provide valuable information and best practices, including an understanding of the regulatory process.data science course
ReplyDeleteAwesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!
ReplyDeletedata analytics course
big data analytics malaysia
big data course
Attend The Course in Data Analytics From ExcelR. Practical Course in Data Analytics Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Course in Data Analytics.
ReplyDeleteCourse in Data Analytics
I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article.
ReplyDeleteSimple Linear Regression
Correlation vs Covariance
Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteCorrelation vs Covariance
Simple linear regression
data science interview questions
ReplyDeleteI am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
360DigiTMG PMP Certification
Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!
ReplyDeletedata analytics course
big data analytics malaysia
big data course
I am looking for and I love to post a comment that "The content of your post is awesome" Great work!data science course
ReplyDeleteThanks for sharing great information. I like your blog and highly recommendData Science Training in Hyderabad
ReplyDeleteReally nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.
ReplyDeletevisit for more details
Very nice blogs!!! i have to learning for lot of information for this sites...Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data science course in Hyderabad
ReplyDeleteYou really make it look so natural with your exhibition however I see this issue as really something which I figure I could never understand. It appears to be excessively entangled and incredibly expansive for me.360DigiTMG data scientist malaysia
ReplyDeleteThis Was An Amazing ! I Haven't Seen This Type of Blog Ever ! Thankyou For Sharing, data scientist course in hyderabad with placement
ReplyDeleteAmazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteCorrelation vs Covariance
Simple Linear Regression
data science interview questions
KNN Algorithm
Logistic Regression explained
HTML stands for Hyper Text Markup Language. HTML is the standard markup language for creating Web pages. HTML describes the structure of a Web page.
ReplyDeleteinternship in chennai for mechanical
internship in chennai for cse students
internship in chennai for eee
internship in chennai for ece students
internship in chennai for bcom students
internship in chennai for mechanical engineering students
python internship in chennai
internship in chennai for it students
companies offering internship in chennai
internship in chennai for it
Thanks for sharining...
ReplyDeleteiot training in delhi
Thanks for sharing such a nice info.I hope you will share more information like this. please keep on sharing!
ReplyDeleteInplant training in chennai
Inplant training in chennai for cse
Inplant training in chennai for ece
Inplant training in chennai for mechanical
Inplant training in chennai for ece students
Inplant training in chennai for eee
Inplant training in bmw chennai
Extraordinary post. I simply found your blog and expected to express that I have genuinely refreshing scrutinizing your blog sections.Huge thankful for the significant data.
ReplyDeleteHRDF training
Amazing Article,Really useful information to all So, I hope you will share more information to be check and share here.
ReplyDeleteinplant training for biotechnology in chennai
inplant training for ece students
inplant training mechanical engineering students
inplant training certificate format for civil engineering
inplant training report ppt
inplant training report samples
inplant training letter format
inplant training report for civil engineering pdf
inplant training report for electrical engineering
Great post! I am actually getting ready to across this information, is very helpful my friend. Also great blog here with all of the valuable information you have. Keep up the good work you are doing here.data science courses
ReplyDeleteI was looking at a portion of your posts on this site and I consider this site is really enlightening! Keep setting up..
ReplyDeletehttps://360digitmg.com/course/data-analytics-using-python-r
Thank you for share us. For more information visit our Best Hospital Management Software in Hyderabad
ReplyDeleteVery nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data sciecne course in hyderabad
ReplyDeleteGood Post! , it was so good to read and useful to improve my knowledge as an updated one, keep blogging.After seeing your article I want to say that also a well-written article with some very good information which is very useful for the readers....thanks for sharing it and do share more posts likethis. https://www.3ritechnologies.com/course/data-science-online-training/
ReplyDeleteSuper article
ReplyDeleteartificial neural network
what is artificial neural network
what is an artificial neural network
application of artificial neural network
artificial neural network application
artificial neural network pdf
artificial neural network ppt
artificial neural network tutorial
artificial neural network definition
artificial neural network types
I found Hubwit as a transparent s ite, a social hub which is a conglomerate of Buyers and Sellers who are ready to offer online digital consultancy at decent cost.
ReplyDeleteBest Institute for Data Science in Hyderabad
I will really appreciate the writer's choice for choosing this excellent article appropriate to my matter.Here is deep description about the article matter which helped me more.
ReplyDeletedata scientist courses
Thanks for sharing amazing blog. I am really happy to read your blog. Thanks for sharing your blog.
ReplyDeleteAndroid Training in Tambaram
Android Training in Anna Nagar
Android Training in Velachery
Android Training in T Nagar
Android Training in Porur
Android Training in OMR
very well explained. I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteLogistic Regression explained
Correlation vs Covariance
Simple Linear Regression
data science interview questions
KNN Algorithm
Bag of Words Python
This is my first time visit here. From the tremendous measures of comments on your articles.I deduce I am not only one having all the fulfillment legitimately here!
ReplyDeleteinternet of things malaysia
Thanks for sharing great information. I highly recommend you.data science courses
ReplyDeleteThanks for sharing the valuable information. it’s really helpful.Best data science courses in hyerabad
ReplyDeleteI've read this post and if I could I desire to suggest you some interesting things or suggestions. Perhaps you could write next articles referring to this article. I want to read more things about it!
ReplyDeletedata science courses
I surely acquiring more difficulties from each surprisingly more little bit of it ExcelR Business Analytics Courses
ReplyDeleteThanks for sharing such a great blog......!!!
ReplyDeletefull form
full form of nrc
nrc full form
mbbs full form
full form of rip
ReplyDeleteThankful to you a particularly lot for ding the stunning situation here, everyone will surely like your post.
iot certification courses
Thanks for sharing a wonderful article, it is helpful for everyone, excellent post.
ReplyDeletedigital marketing trends
big data vs data science
latest technology trends
types of graphic design
rpa interview questions
angularjs interview questions
NTC National Telecommunication Corporation Jobs
ReplyDelete