Spring Websockets and RabbitMQ fallback

java
Question: From the Spring Framework documentation there are a few options for the message brokers for handling the messages. One is the in memory message broker provided by Spring, and list of a few others (RabbitMQ was selected). To build a more robust system, is there some configuration that can be set, that if RabbitMQ goes down Spring can detect this and revert to its in memory message broker? Then go back to RabbitMQ when it comes back up. Answer: Read more
Read More

how send json content using httpurlconnection in saleforce

Uncategorized
Question: String uri = baseUri + "/sobjects/Lead/"+leadId; System.out.println(uri); HttpsURLConnection connection =null; URL url = new URL(uri); connection = (HttpsURLConnection) url.openConnection(); connection.setDoInput (true); connection.setDoOutput (true); //connection.setUseCaches (false); connection.setRequestProperty("Authorization", "OAuth "+loginAccessToken); connection.setRequestProperty("X-PrettyPrint", "1"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestMethod("POST"); JSONObject lead = new JSONObject(); lead.put("LastName", "Lead --UPDATED"); OutputStreamWriter output=new OutputStreamWriter(connection.getOutputStream()); output.append(lead.toString()); output.flush(); javax.net.ssl.SSLSocketFactory sslSocketFactory = getFactorySimple(); connection.setSSLSocketFactory(sslSocketFactory); int response1= connection.getResponseCode(); System.out.println(connection.getResponseMessage()); System.out.println(response1); But i am getting output as follows https://ap2.salesforce.com/services/data/v40.0/sobjec/Lead/00Q2800000YUNrXEAX Bad Request 400 Answer: Read more
Read More

Xamarin Android not respond after build with embedded jar

Uncategorized
Question: I have created a Xamarin android app and a binding library which contains a JAR file (build action as embedded jar). The app build successful after I add the binding library as reference. However when I call the function in the jar, the app shows no respond (black screen). It doesn't throw any exception. I try to debug in visual studio but when the line goes to the jar file (reach the line of the function in jar), it just disappear and I cannot find which line in the jar file goes wrong. How can I debug in this situation? Below is the code example, the BankCard is a class in the JAR file. The app does not respond after running mBankCard.CardReaderDetact function. private BankCard mBankCard = new BankCard(Android.App.Application.Context);…
Read More

cross cluster search with elastic search scalability tests / performance results

Uncategorized
Question: My question is with reference to elasticsearch's new feature 'cross cluster search' https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cross-cluster-search.html Are there any performance tests/ studies available for this feature? How scalable is it? One use case we have is, 10 clusters with 1 million documents each (total 10 mil across all clusters) Are there any other open source software available for cross cluster search/ federated search? (need to support pagination, any column search, and sorting) Answer: Read more
Read More

Angular2/4 – Switchmap keeps triggering more and more requests on every subsequent search

Uncategorized
Question: I've got an issue with (presumably) switchmap function used for my live search. EDIT: My input looks like this: There is a function getting triggered by an input which uses a service to make https request to the server. searchPartnerByName(event) { if ( event.length < 3 ) {return; } this.partnersParams.searchText = event; this.searchTermPartner.next(event); this.loadingService.changeBool(true); this.partnersService.search(this.searchTermPartner, this.partnersParams).subscribe(partnersResult => {} Now the search function gets called. constructor(private httpService: HttpService) { } search(terms: Observable, params: PartnersParams) { return terms.debounceTime(300) .distinctUntilChanged() .switchMap(term => this.searchEntries(params)) .share(); } public searchEntries(params: PartnersParams): Observable { console.log(params); return this.httpService.post(this.apiUrl, params) .map((res: Response) => new PartnersResult(res.json())); } When string length is 3 (search gets triggered), it makes one HTTP request but then on every additional character it makes one more than the previous. 4 characters will result in 2…
Read More